Exam 4: The Selection Structure
Exam 1: An Introduction to Visual Basic 201560 Questions
Exam 2: Designing Applications60 Questions
Exam 3: Using Variables and Constants60 Questions
Exam 4: The Selection Structure59 Questions
Exam 5: More on the Selection Structure60 Questions
Exam 6: The Repetition Structure60 Questions
Exam 7: Sub and Function Procedures60 Questions
Exam 8: String Manipulation60 Questions
Exam 9: Arrays60 Questions
Exam 10: Structures and Sequential Access Files60 Questions
Exam 11: Classes and Objects60 Questions
Exam 12: Web Applications60 Questions
Exam 13: Working With Access Databases and Linq60 Questions
Exam 14: Access Databases and Sql60 Questions
Select questions type
When coding a selection instruction in Visual Basic, the code that follows the Else statement includes those instructions that will be executed when the condition is true.
Free
(True/False)
4.9/5
(34)
Correct Answer:
False
Problems - Correcting Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
An application needs to display whether or not a student has been accepted to college. The program needs to display either "Accepted" or "Not Accepted". A student must have an SAT score of 1750 or higher and a GPA of 3.3 or higher. Rewrite the following If statement to correct all errors:
If intSAT = 3.3 Then
lblMessage.Text = "Not Accepted"
Else
lblMessage.Text = "Accepted"
End If
Free
(Essay)
4.8/5
(30)
Correct Answer:
If intSAT >= 1750 AndAlso decGPA >= 3.3 Then
lblMessage.Text = "Accepted"
Else
lblMessage.Text = "Not Accepted"
End If
Case-Based Critical Thinking Questions Case 1 - Jack of All Trades
Jack of All Trades rents small power equipment to commercial and residential customers. The strCustomer variable is used to determine whether a customer is commercial (C) or residential (R). Commercial customers receive a 10% discount if they are members of the Rental Rewards Program. Residential customers receive a 5% discount if they are members.
The button selected by the clerk will determine the next task performed by the computer. The application is using the ____ of the MessageBox.Show method.
Free
(Multiple Choice)
4.9/5
(42)
Correct Answer:
B
Use the ____ flowchart symbol to represent the condition in both the selection and repetition structures.
(Multiple Choice)
4.8/5
(27)
A variable that has ____ scope can be used anywhere within the procedure.
(Multiple Choice)
4.8/5
(31)
If the intQuantity and decPrice variables contain the numbers 3 and 15.75, respectively, the condition If intQuantity > 0 AndAlso intQuantity 20 will evaluate to ____.
(Multiple Choice)
5.0/5
(42)
You use the ____ method to select all of the text contained in a text box.
(Multiple Choice)
4.8/5
(27)
In the MessageBox.Show( text , caption , buttons , icon [, defaultButton ]) method, which of the following arguments controls the words appearing on the message box title bar?
(Multiple Choice)
4.8/5
(31)
Your professor wants an application that allows a student to enter two grades and calculate the average of those grades. The application should display the message "Pass" if the average of the grades is 70 or greater. The application should display the message "Fail if the average of the grades is less than 70. Write the pseudocode for the solution to this problem.
(Essay)
4.8/5
(38)
Write an If clause to determine whether the user pressed the Backspace key.
(Essay)
4.8/5
(22)
To prevent a text box from accepting inappropriate characters, you first use the e parameter's ____ property to determine the key that the user pressed.
(Multiple Choice)
4.9/5
(35)
If dblMiles >= 500 Then dblMiles = dblMiles * 0.45
Else
DblMiles = dblMiles * 0.25
End If
The dblMiles variable contains the number 575 before the code above is processed. What value will be in the variable after the code is processed?
(Multiple Choice)
4.9/5
(40)
The And operator always checks both conditions, while the AndAlso operator does not always evaluate the second condition.
(True/False)
4.9/5
(35)
Write an If clause to determine whether the dblTemp variable contains a number that is between 65 and 75.
(Essay)
4.8/5
(28)
Before using a string in a comparison, you can use either the ToUpper method or the ToLower method to convert the string to uppercase or lowercase, respectively, and then use the converted string in the comparison.
(True/False)
4.8/5
(35)
You can use a(n) ____ to visually separate related controls from other controls on the form.
(Multiple Choice)
4.8/5
(37)
With the KeyPress event, use the e parameter's ____ property to cancel the key if it is an inappropriate one.
(Multiple Choice)
4.8/5
(31)
Showing 1 - 20 of 59
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)