Visual Basic Programming Exam Solutions - 802 Verified Questions

Page 1


Visual Basic Programming Exam

Solutions

Course Introduction

Visual Basic Programming introduces students to the fundamental concepts and techniques of software development using the Visual Basic programming language. The course covers the creation of graphical user interfaces, event-driven programming, control structures, data types, and the use of built-in functions. Emphasis is placed on problem-solving methods, debugging, and designing user-friendly applications. Students will gain practical experience by developing small-scale projects and applications, preparing them for more advanced programming concepts and real-world application development.

Recommended Textbook

Programming with Microsoft Visual Basic 2012 6th Edition by Diane Zak

Available Study Resources on Quizplus

14 Chapters

802 Verified Questions

802 Flashcards

Source URL: https://quizplus.com/study-set/3279

Page 2

Chapter 1: An Introduction to Visual Basic 2012

Available Study Resources on Quizplus for this Chatper

59 Verified Questions

59 Flashcards

Source URL: https://quizplus.com/quiz/65089

Sample Questions

Q1) The Toolbox window ____.

A) displays the names of projects and files included in a solution

B) displays data connections and servers

C) displays the tools you use when creating your application's interface

D) displays the classes,methods,and properties included in a solution

Answer: C

Q2) What is the Windows Form Designer window? Describe how it is used in Visual Studio 2012.

Answer: The Windows Form Designer window is where you create (or design)your application's graphical user interface.It is used to create the Windows Form object,or form.The form is the foundation of the user interface in a Windows application.You use the Windows Form Designer window to create the form and add all of the necessary objects to the form that are needed for the application to work properly.

Q3) What is a label control? Explain how it is used on a form.

Answer: A label control is a control that contains descriptive text.It is often used to display text that the user is not allowed to edit while an application is running.

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Designing Applications

Available Study Resources on Quizplus for this Chatper

57 Verified Questions

57 Flashcards

Source URL: https://quizplus.com/quiz/65090

Sample Questions

Q1) The following expression should subtract 10 from the txtPrice control and then multiply the result by .07: lblSalesTax.Text = Val(txtPrice.Text)- 10 * .07

Answer: lblSalesTax.Text = (Val(txtPrice.Text)- 10)* .07

Q2) In most cases,an identifying label should be from one to three words only and appear on one line.

A)True

B)False

Answer: True

Q3) If the user enters $20 in the txtPrice control and 4 in the txtQuantity control,the Val(txtPrice.Text)* Val(txtQuantity.Text)expression will evaluate to ____.

A) 0

B) 40

C) 80

D) none of the above

Answer: A

Q4) Write a statement that clears the contents of the Text property of the txtLastName control.

Answer: txtLastName.Text = String.Empty

To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: Using Variables and Constants

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

Source URL: https://quizplus.com/quiz/65091

Sample Questions

Q1) A local gym needs an application to apply a 10% discount for all new members who present a coupon during enrollment.Write the statements to declare a variable to record if a customer has a coupon,and to assign the discount rate.The discount rate will not change while the application is running.

Answer: Dim blnCoupon As Boolean

Const decDISCOUNT As Decimal = .1

Q2) To simplify the coding of the InputBox function,the prompt and the title for the InputBox can be declared as ____ because they will not change while the application runs.

A) string variables

B) static variables

C) Boolean variables

D) named constants

Answer: D

Q3) A memory variable that is a Double data type requires ____ bytes of storage.

A) 2

B) 4

C) 6

D) 8

Answer: D

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: The Selection Structure

Available Study Resources on Quizplus for this Chatper

57 Verified Questions

57 Flashcards

Source URL: https://quizplus.com/quiz/65092

Sample Questions

Q1) The message provided when a customer is not a current member of the Rental Rewards Program is "Enroll this customer in the Rental Rewards Program?".The clerk must enter a decision before the application can continue.Which of the message box buttons should be used?

A) OK

B) OKCancel

C) YesNo

D) Information

Q2) If the intInventory variable contains the value 28,the condition If intInventory <= 25 Then will evaluate to ____.

A) Yes

B) No

C) True

D) False

Q3) The And operator always checks both conditions,while the AndAlso operator does not always evaluate the second condition.

A)True

B)False

Q4) What is a group box and how is it used?

To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: More on the Selection Structure

Available Study Resources on Quizplus for this Chatper

56 Verified Questions

56 Flashcards

Source URL: https://quizplus.com/quiz/65093

Sample Questions

Q1) Write an If...Then...Else statement that assigns a discount of $5 when a customer provides a coupon during checkout.If the customer does not provide a coupon,then there is no discount.The clerk must select the Coupon Provided check box for the customer to receive the discount.Create your own variable names.

Q2) Reversing the primary and secondary logical decisions when writing a selection structure that contains a nested selection structure has no impact on the program's execution.

A)True

B)False

Q3) Write the TryParse statement that will convert the string stored in the txtBalance control to a Decimal number.The Decimal number should be stored in the decBalance variable,and the Boolean value that is returned should be stored in the blnIsNumber variable.

Q4) The condition in a multiple-path selection structure is represented by a ____ in a flowchart.

A) diamond

B) square

C) circle

D) rectangle

To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: The Repetition Structure

Available Study Resources on Quizplus for this Chatper

59 Verified Questions

59 Flashcards

Source URL: https://quizplus.com/quiz/65094

Sample Questions

Q1) What is a counter-controlled loop and when is it used in a program? What statement provides the most efficient way to write a counter-controlled loop?

Q2) A counter is always incremented by a constant value.

A)True

B)False

Q3) What is a list box? Provide two of the Windows standards for its use on a form.

Q4) What is a counter? What does it mean to initialize and update a counter in a program?

Q5) Like the condition in a selection structure,the condition in a loop must evaluate to either True or False.

A)True

B)False

Q6) Adding increments of a negative number is referred to as ____.

A) decrementing

B) initializing

C) deprocessing

D) negating

Q7) What is an accumulator? What does it mean to initialize and update an accumulator in a program?

8

To view all questions and flashcards with answers, click on the resource link above.

Chapter 7: Sub and Function Procedures

Available Study Resources on Quizplus for this Chatper

56 Verified Questions

56 Flashcards

Source URL: https://quizplus.com/quiz/65095

Sample Questions

Q1) A combo box's ____ property contains the value that appears in the text portion of the control.

A) Add

B) Sorted

C) Text

D) list

Q2) An independent Sub procedure is a procedure that is independent of any object and event.

A)True

B)False

Q3) A(n)____ is processed only when it is called (invoked)from code.

A) dependent Sub procedure

B) independent Sub procedure

C) event procedure

D) independent event procedure

Q4) An application uses a message box to ask users whether they want to exit the application,and the return value is stored in the dlgButton variable.Write the statement needed to stop the computer from closing the form if the user selects the No button in the message box.

Q5) What is the difference between a Sub procedure and a Function procedure?

Page 9

To view all questions and flashcards with answers, click on the resource link above.

Chapter 8: String Manipulation

Available Study Resources on Quizplus for this Chatper

57 Verified Questions

57 Flashcards

Source URL: https://quizplus.com/quiz/65096

Sample Questions

Q1) To insert characters within a string,you use the ____ method.

A) Add

B) Insert

C) Mid

D) IndexOf

Q2) Each menu in an application does not have to contain a menu title.

A)True

B)False

Q3) Write the condition that evaluates to True when the string stored in the strCode variable begins with "HFS",followed by two uppercase letters,followed by five numbers.

Q4) Assume that a text box named PhoneNumberTextBox appears on a form and contains the phone number 414-555-5555.What value will display for the length of the phone number text box?

A) 10

B) 12

C) 18

D) 20

Q5) Write the Visual Basic statement to assign the number of characters in the txtSSN control's Text property to the intSSNNumChar variable.

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Arrays

Available Study Resources on Quizplus for this Chatper

57 Verified Questions

57 Flashcards

Source URL: https://quizplus.com/quiz/65097

Sample Questions

Q1) When a run time error occurs,the computer displays an error message and the application ends abruptly.

A)True

B)False

Q2) Write the statement to declare a twelve-row,two-column procedure-level array named strLocations,initializing each element to the keyword Nothing.

Q3) Assigning initial values to an array is often referred to as ____.

A) sorting the array

B) populating the array

C) assigning the array

D) declaring the array

Q4) Write the statements to traverse the strCategory array and display each element's value in the lstCategory control.Use a For Each...Next statement.

Q5) If a one-dimensional array contains five elements,its Length property contains the number 5 but its highest subscript is 3.

A)True

B)False

Q6) Explain the difference between a simple variable and an array.

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Structures and Sequential Access Files

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

Source URL: https://quizplus.com/quiz/65098

Sample Questions

Q1) Describe two advantages to programmers of using structures and structure variables.

Q2) Assume that the variable amount contains the value 46.How many characters will be padded in the statement below? amount = amount.ToString.PadLeft(5)

A) two

B) three

C) four

D) five

Q3) Write a Structure statement that defines a structure named Order.The structure contains four member variables named strItemNum,strItemDesc,decPrice,and intQuantity.Then write the Dim statement that declares an Order variable named furniture.

Q4) Most programmers use the Structure statement,rather than the Class statement,to create data types that contain procedures.

A)True

B)False

Q5) You reserve memory locations by declaring a structure variable. A)True B)False

To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 11: Classes and Objects

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

Source URL: https://quizplus.com/quiz/65099

Sample Questions

Q1) Which of the following clauses allows a derived class named Truck to have the same attributes and behaviors as its base class,which is named Automobile?

A) Inherit Truck

B) Inherits Truck

C) Inherit Automobile

D) Inherits Automobile

Q2) ____ are the operations (actions)that the object is capable of performing.

A) Events

B) Attributes

C) Behaviors

D) Methods

Q3) A(n)____ property gets its value from the class itself rather than from the application.

A) WriteOnly

B) ReadOnly

C) Set block

D) Get block

Q4) Define the term "inheritance" in object-oriented programming and describe its use.

To view all questions and flashcards with answers, click on the resource link above.

Page 13

Chapter 12: Web Applications

Available Study Resources on Quizplus for this Chatper

55 Verified Questions

55 Flashcards

Source URL: https://quizplus.com/quiz/65100

Sample Questions

Q1) When a client computer's browser sends a request for an ASP page,the Web server locates the page and then sends the appropriate ____ instructions to the client.

A) C++

B) Java

C) system

D) HTML

Q2) A drop-down list control has been added to a Web page.Add the following three products as list items to the control: washer,dryer,and refrigerator.

Q3) You can add an image to a Web page using the ____ tool in the toolbox.

A) Canvas

B) Paint

C) Layer

D) Image

Q4) You can add static text to a Web page using a ____.

A) Web application

B) browser

C) label control

D) format control

Q5) What is the difference between a static Web page and a dynamic Web page?

To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: Working With Access Databases and Linq

Available Study Resources on Quizplus for this Chatper

57 Verified Questions

57 Flashcards

Source URL: https://quizplus.com/quiz/65101

Sample Questions

Q1) Write a LINQ statement to select all blue bicycles.Order the bicycles in ascending order by quantity.

Q2) The BindingSource object's ____ methods move the record pointer to the first,last,next,or previous record in the dataset.

A) Position

B) View

C) Move

D) Navigation

Q3) Write a LINQ statement to select all bicycles with a price greater than $450.Arrange the bicycles in descending order by price.

Q4) If a user is not allowed to add a record,you should deselect the ____ check box within the task list for the DataGridView control.

A) Enable Adding

B) Enable Deleting

C) Edit Items

D) BindingNavigatorAddNewItem

Q5) Write the statements to move the record pointer to the first and last records in the dataset for the Customer table.

To view all questions and flashcards with answers, click on the resource link above. Page 15

Chapter 14: Access Databases and SQL

Available Study Resources on Quizplus for this Chatper

58 Verified Questions

58 Flashcards

Source URL: https://quizplus.com/quiz/65102

Sample Questions

Q1) The ____ clause is used to arrange the records in either ascending (the default)or descending order by one or more fields.

A) GROUP BY

B) WHERE

C) ORDER BY

D) JOIN

Q2) Three records were added to the ContractsDataSet.Write the statement to save the records in the Contracts database.

Q3) If you want the records in a dataset to appear in a particular order when the application is started,you enter the Sort method in the form's ____.

A) Start event procedure

B) Load event procedure

C) Refresh event procedure

D) Click event procedure

Q4) A Delete query uses the ____ statement to delete a record from a database.

A) UPDATE

B) SELECT

C) INSERT

D) DELETE

To view all questions and flashcards with answers, click on the resource link above. Page 16

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Visual Basic Programming Exam Solutions - 802 Verified Questions by Quizplus - Issuu