App Development Exam 1

¡Supera tus tareas y exámenes ahora con Quizwiz!

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to Code Example 4-1.) What is the value of x after the following statement is executed? Dim x As Integer = k Mod j a. 1 c. 3 b. 2 d. 4

A

If you declare a variable within a procedure, the variable will be available a. $1,234.56 c. from any class in the project b. from any procedure of the class d. from any procedure with the same scope

A

Which of the following types of .NET applications does not provide for an enhanced user experience? a. ASP.NET Web Forms c. Silverlight b. WPF d. Windows Store

A

Assuming total is a decimal variable and totalString is a string variable, which of the following statements is valid code for converting totalString into the corresponding decimal value and storing the converted value in total? a. totalString.TryParse(total) b. total.TryParse(totalString) c. Decimal.TryParse(totalString, total) d. Decimal.TryParse(total, totalString)

N/A

N/A

N/A

If a Decimal variable named total has a value of 1234.56, what string will result from the following statement? Dim s As String = total.ToString("c2") a. $1,234.56 c. 1234.56 b. 1,234.56 d. 1235

A. $1,234.56

Variables named according to camel notation a. capitalize the first letter of every word after the first word b. use all lowercase letters c. capitalize the first letter of every word including the first word d. capitalize only the first letter of the variable name

A. capitalize the first letter of every word after the first word

A class is a. the code that defines the characteristics of an object b. the code for a Windows form c. a grouping of related objects d. an instance of an object

A. the code that defines the characteristics of an object

If you use banker's rounding with the Round method of the Math class, a positive number that ends in 5 is always rounded a. to the nearest even number b. to the nearest odd number c. up to the next number d. down to the next number

A. to the nearest even number

An assembly is a. the source file for a .NET application b. an executable file that includes the MSIL or IL c. a container that holds projects d. a secondary file required by an application, such as a graphic image or sound file

B

Before a Visual Basic application can be run, it must be compiled into a language called a. Microsoft Common Language c. Microsoft Runtime Language b. Microsoft Intermediate Language d. Microsoft Solution Language

B

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to Code Example 4-1.) What is the value of x after the following statements are executed? Dim x As Integer = 27 x -= i a. 4 c. 27 b. 23 d. 31

B

To change the file name for a form, project, or solution you can use the a. Form Designer c. Code Editor b. Solution Explorer d. Toolbox

B

What does the following code do? txtMonthlyInvestment.Select() a. calls the Select method of the current form instance b. calls the Select method of the txtMonthlyInvestment control c. calls the txtMonthlyInvestment method of the Select control d. calls the () method of the txtMonthlyInvestment.Select control

B

What event does Visual Studio generate code for when you double-click a button in the Form Designer? a. DoubleClick c. Enter b. Click d. Load

B

What is the name of the procedure that's generated when you double-click a button named btnProcess in the Form Designer? a. btnProcess.Click c. btnProcess.DoubleClick b. btnProcess_Click d. btnProcess_DoubleClick

B

What is the purpose of the Common Language Runtime? a. it provides pre-written code that can be used by .NET applications b. it manages the execution of .NET applications c. it specifies the format of compiled .NET applications d. it specifies the data types that can be used by .NET applications

B

What is the value of the cityState string after this statement is executed? cityState = "Milwaukee" cityState &= "," & "Wisconsin" a. Milwaukee, Wisconsin c. MilwaukeeWisconsin b. Milwaukee,Wisconsin d. Wisconsin

B

Which of the following is a valid comment? a. \ This is a comment b. ' This is a comment c. / This is a comment d. * This is a comment

B

Which of the following statements is not true about the following code? Dim total As Decimal = 0.0d Private Sub btnCalculate_Click(Sender As Object, e As EventArgs) Handles btnCalculate.Click Dim calculateCount As Integer = 0 . . End Sub a. The variable total has module scope. b. The variable calculateCount has module scope. c. The variable total is accessible in the btnCalculate_Click procedure. d. The variable calculateCount is accessible in the btnCalculate_Click procedure.

B

Which statement is equivalent to the following statement? total = total + tax a. total = tax++ b. total += tax c. total = ++tax d. total =+ tax

B

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to Code Example 4-1.) What is the value of x after the following statement is executed? Dim x As Integer = k \ (j - i) a. 2 c. 4.25 b. 4 d. 8

B. 4

Assuming that a variable named sales contains a string that represents a valid Decimal number, which of the following statements is valid code for converting the sales string to a Decimal value? a. Dim d As Decimal = Parse.Decimal(sales) b. Dim d As Decimal = Decimal.Parse(sales) c. Dim d As Decimal = sales d. Dim d As Decimal = Convert.Decimal(sales)

B. Dim d As Decimal = Decimal.Parse(sales)

Assuming total is a Decimal variable, which of the following statements does not convert it to a string? a. Dim s As String = "Total: " & total b. Dim s As String = String.Parse(total) c. Dim s As String = total.ToString() d. Dim s As String = Convert.ToString(total)

B. Dim s As String = String.Parse(total)

What is the term for a procedure that responds to events? a. event wiring c. event method b. event handler d. event handling method

B. event handler

A constant stores data a. that changes as a program executes b. that does not change as a program executes c. that does not need to be initialized d. that is a reference type

B. that does not change as a program executes

To say that a Visual Basic application is event-driven means that it responds to a. user events only c. application events only b. user events and other types of events d. class events only

B. user events and other types of events

A Windows Forms application runs a. in a web browser c. under the Windows operating system b. under control of the compiler d. in the console of Visual Studio

C

A solution is a. the source file for a .NET application b. an executable file that contains MSIL or IL c. a container that holds projects d. a secondary file required by an application, such as a graphic image or sound file

C

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to Code Example 4-1.) What is the value of x after the following statement is executed? Dim x As Decimal = a + b a. 2.5 c. 6.5 b. 6 d. 10.0

C

The tab order determines the order in which a. the tabs in the Form Designer window are displayed b. the user must enter data into the controls on a form c. the controls on a form receive focus when the user presses the Tab key d. the controls are displayed on the form

C

To refer to a property of an object in your Visual Basic code, you code the a. class name followed by a period and the property name b. property name followed by a period and the object name c. object name followed by a period and the property name d. property name followed by a period and the class name

C

Two properties that are common to both forms and controls are the a. Name and AcceptButton properties c. Name and Text properties b. Name and TabIndex properties d. TabIndex and AcceptButton properties

C

To concatenate a string with another string or a value data type, you use this character: a. # c. & b. | d. +

C. &

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to Code Example 4-1.) What is the value of x after the following statement is executed? Dim x As Integer = i + j a. 4 c. 12 b. 8 d. 32

C. 12

Which of the following is a valid Decimal literal? a. 30.0 b. 30.0c c. 30.0d d. 30.0m

C. 30.0d

Which built-in data type is the most precise type for storing monetary values? a. Double c. Decimal b. Single d. Money

C. Decimal

The .NET Framework Class Library consists of a. solutions that are organized into sublibraries b. solutions that are organized into namespaces c. classes that are organized into sublibraries d. classes that are organized into namespaces

D

The Text property of a control determines a. the name that you use to refer to the control in your Visual Basic code b. the name of the control and the text that's displayed in it c. the text that's displayed in the form d. the text that's displayed in the control

D

The primary components of the .NET Framework are the .NET Framework Class Library and the a. Command Language Runtime c. Managed Type Runtime b. Common Type Library d. Common Language Runtime

D

To continue a Visual Basic statement following an element that doesn't allow implicit line continuation, you code a. a hyphen (-) b. a space and a hyphen ( -) c. an underscore (_) d. a space and an underscore ( _)

D

To write the Visual Basic code for a form, you use a Visual Studio window called the a. Form Designer c. Toolbox b. Solution Explorer d. Code Editor

D

What form property do you use to activate a button control when the user presses the Enter key? a. EnterButton property c. AcceptButton property b. OKButton property d. CancelButton property

D

Which of the following statements is true? a. The Label control has a TabStop property, but it is ignored. b. The Label control has a TabStop property and can accept focus. c. The Label control has a TabStop property, but can't accept focus. d. The Label control doesn't have a TabStop property.

D

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to code example 4-1.) What is the value of x after the following statement is executed? Dim x As Decimal = Math.Round(c) a. 0 c. 12.7 b. 12 d. 13

D. 13

Dim a As Decimal = 2.5D Dim b As Decimal = 4.0D Dim c As Decimal = 12.7D Dim i As Integer = 4 Dim j As Integer = 8 Dim k As Integer = 17 (Refer to Code Example 4-1.) What is the value of x after the following statement is executed? Dim x As Integer = j / CInt(a) a. 2 c. 3.2 b. 3 d. 4

D. 4

Which built-in data type stores only whole numbers? a. Whole c. Number b. Float d. Integer

D. Integer

An object is a. the code that defines the characteristics of a class b. the code for a Windows form c. a grouping of related classes d. an instance of a class

D. an instance of a class


Conjuntos de estudio relacionados

Chapter 2: The Internet, the Web, and Electronic Commerce

View Set

Chapter 8: Business Organization

View Set

Lifespan Interactive Modules 3-4

View Set

Real Estate Exam Prep 2018 version TEST

View Set

EMT: Chapter 33 [obstetrics & neonatal care]

View Set