Deck 4: The Selection Structure

Full screen (f)
exit full mode
Question
The ____ operator is evaluated last in the following expression: 9 * 2 - 8 > 5 + 2 / 2.

A) -
B) +
C) >
D) *
Use Space or
up arrow
down arrow
to flip the card.
Question
You can include an identifying label on a group box by setting the group box's Identity property.
Question
The expression 12 > 0 AndAlso 12
Question
If the intInventory variable contains the value 28, the condition If intInventory will evaluate to ____.

A) Yes
B) No
C) True
D) False
Question
The diamond symbol is used in a flowchart for a calculation task.
Question
The ____ operator is evaluated first in the following expression: 9 * 2 - 8 > 5 + 2 / 2.

A) -
B) +
C) >
D) *
Question
The Not operator would make a True statement False, but would not make a False statement True.
Question
A programmer must phrase the condition of a selection structure so that it results in either a true or a false answer only.
Question
Comparison operators are also referred to as ____ operators.

A) relational
B) arithmetic
C) logical
D) Boolean
Question
Comparison operators are always evaluated after arithmetic operators in a conditional expression.
Question
Which of the following has the most limited scope?

A) a variable declared at the beginning of a procedure
B) a variable declared within the true path of a selection structure
C) a static variable declared at the beginning of a procedure
D) a class-level variable
Question
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?

A) 0
B) 143.75
C) 225
D) 258.75
Question
The expression 2 * 3 + 1 > 1 * 2 + 3 Or 7 + 2
Question
The And operator always checks both conditions, while the AndAlso operator does not always evaluate the second condition.
Question
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.
Question
A variable that has ____ scope can be used anywhere within the procedure.

A) block
B) statement
C) method
D) procedure
Question
Use the ____ flowchart symbol to represent the condition in both the selection and repetition structures.

A) oval
B) rectangle
C) parallelogram
D) diamond
Question
What is the value of the following expression: 9 * 2 - 8 > 5 + 2 / 2?

A) 10
B) 6
C) False
D) True
Question
Which of the following conditions will evaluate to True when the intPackages variable contains the value 100?

A) If intPackages = 100 Then
B) If intPackages 0 Then
C) If intPackages > 1 Then
D) All of the above would evaluate to True.
Question
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.
Question
Logical operators are sometimes referred to as ____ operators.

A) relational
B) arithmetic
C) comparison
D) Boolean
Question
You use the ____ method to select all of the text contained in a text box.

A) All
B) SelectAll
C) AllText
D) GetAll
Question
In the MessageBox.Show( text , caption , buttons , icon [, defaultButton ]) method, which of the following arguments controls the symbol appearing in the message box?

A) text
B) caption
C) buttons
D) icon
Question
The Backspace key is represented by the ____ constant.

A) ControlChars.Back
B) ControlChars.BackSpace
C) ControlChars.Backspace
D) ControlChars.Backspc
Question
A control's ____ event occurs each time the user presses a key while the control has the focus.

A) PressEnter
B) KeyEnter
C) KeyPress
D) FocusPress
Question
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.
Which of the following If clauses would evaluate to True and apply the 10% discount for a commercial customer?

A) If strCustomer "C" AndAlso strMember "Y"
B) If strCustomer = "C" AndAlso strMember = "Y"
C) If strCustomer "R" OrElse strMember = "Y"
D) If strCustomer = "C" OrElse strMember = "Y"
Question
A text box's ____ event occurs when the text box receives the focus.

A) Focus
B) It
C) Key
D) Enter
Question
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?

A) text
B) caption
C) buttons
D) icon
Question
Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed second?

A) ^
B) /
C) *
D) +
Question
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 ____.

A) True
B) False
C) Yes
D) No
Question
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.

A) KeyStruck
B) KeyEnter
C) KeyChar
D) KeyPress
Question
Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed first?

A) ^
B) /
C) *
D) +
Question
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 application needs to display a message box to remind the clerk to ask customers to join the Rental Rewards Program when they check out. This message box should only display if the customer is not currently in the program. Which of the following If clauses would evaluate to True and display the message box for the clerk?

A) If strMember "Y" Then
B) If strMember = "Y" Then
C) If strMember = "N" Then
D) a and c
Question
The ____ method displays a message box that contains text, one or more buttons, and an icon.

A) MessageBox.Display
B) MessageBox.Group
C) MessageBox.Show
D) MessageBox.Output
Question
Which of the following statements assigns the contents of the txtGrade control, in uppercase, to the strGrade variable?

A) If strGrade = txtGrade.Text.ToUpper Then
B) strGrade.ToUpper = txtGrade.Text
C) strGrade = txtGrade.Text.ToUpper
D) txtGrade.Text.ToUpper = strGrade
Question
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 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
Question
With the KeyPress event, use the e parameter's ____ property to cancel the key if it is an inappropriate one.

A) Check
B) KeyEnter
C) KeyChar
D) Handled
Question
In the MessageBox.Show( text , caption , buttons , icon [, defaultButton ]) method, which of the following arguments controls the words appearing in the message box?

A) text
B) caption
C) buttons
D) icon
Question
Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed last?

A) ^
B) -
C) >
D) AndAlso
Question
You can use a(n) ____ to visually separate related controls from other controls on the form.

A) radio button
B) check box
C) group box
D) icon area
Question
What is a group box and how is it used?
Question
Write an If statement that allows only numbers and a decimal place to be accepted.
Question
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.
If a customer decides to enroll in the Rental Rewards Program, the Member Information Form displays for the clerk to enter the membership data for the customer. Which of the following statements sends the focus to the txtFirstName control and highlights any text within it?

A) SelectAll(txtFirstName.text)
B) txtFirstName.SelectAll()
C) Focus(txtFirstName.text)
D) txtFirstName.Focus()
Question
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.
Question
Problems - Correcting Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
An application needs to display the message "Please add water" when the amount of water has fallen below the safe limit. Rewrite the following If statement to correct all errors:
If intWaterLimit
lblWarning = "Please add water"
End If
Question
Write a statement that changes the contents of the txtStatus control's text property to uppercase and stores it in the strStatus variable.
Question
Write an If clause to determine whether the dblTemp variable contains a number that is between 65 and 75.
Question
Write an If clause that will determine if the strColor variable contains either the string "red" or the string "blue".
Question
Gino's Subs & Pies wants an application that allows a user to enter a customer's order total and address. When a customer purchases $30 or more of food, Gino's offers free delivery. The delivery fee for all other orders is $10. The calculation should display the total amount the customer owes, including any delivery fee. Draw the flowchart for the solution to this problem.
Question
Write an If clause to determine whether the user pressed the Backspace key.
Question
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
Question
Write an If...Then...Else statement that displays the string "Balance Due" in the lblMessage control when the decBalance variable contains a number that is greater than 0; otherwise, assign the string "Thank you for your payment."
Question
List the three most commonly used icons for display in a message box.
Question
What is a selection structure? What is the difference between a single-alternative and dual-alternative selection structure?
Question
Write a statement that creates a message box that displays an OK button, an Information icon, "Harris Pharmacy" in the title bar, and the message "Please enter a pickup time for your order".
Question
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.

A) Boolean value
B) return value
C) selection structure
D) function
Question
An application needs to calculate a discount for customers who are either preferred customers or senior citizens. Preferred customers have a discount code of  "P". Senior citizens have a discount code of "S". The discount code is stored in the strCode variable. Write an If clause to calculate a discount for all preferred members and senior citizens using the strCode variable.
Question
Write an If...Then...Else statement that assigns the number 2000 to the intBonus variable when the decSales variable contains a number that is greater than or equal to $50,000; otherwise, assign the number 500.
Question
Complete the chart shown below.
Complete the chart shown below.  <div style=padding-top: 35px>
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/59
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: The Selection Structure
1
The ____ operator is evaluated last in the following expression: 9 * 2 - 8 > 5 + 2 / 2.

A) -
B) +
C) >
D) *
C
2
You can include an identifying label on a group box by setting the group box's Identity property.
False
3
The expression 12 > 0 AndAlso 12
True
4
If the intInventory variable contains the value 28, the condition If intInventory will evaluate to ____.

A) Yes
B) No
C) True
D) False
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
5
The diamond symbol is used in a flowchart for a calculation task.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
6
The ____ operator is evaluated first in the following expression: 9 * 2 - 8 > 5 + 2 / 2.

A) -
B) +
C) >
D) *
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
7
The Not operator would make a True statement False, but would not make a False statement True.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
8
A programmer must phrase the condition of a selection structure so that it results in either a true or a false answer only.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
9
Comparison operators are also referred to as ____ operators.

A) relational
B) arithmetic
C) logical
D) Boolean
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
10
Comparison operators are always evaluated after arithmetic operators in a conditional expression.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
11
Which of the following has the most limited scope?

A) a variable declared at the beginning of a procedure
B) a variable declared within the true path of a selection structure
C) a static variable declared at the beginning of a procedure
D) a class-level variable
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
12
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?

A) 0
B) 143.75
C) 225
D) 258.75
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
13
The expression 2 * 3 + 1 > 1 * 2 + 3 Or 7 + 2
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
14
The And operator always checks both conditions, while the AndAlso operator does not always evaluate the second condition.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
15
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.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
16
A variable that has ____ scope can be used anywhere within the procedure.

A) block
B) statement
C) method
D) procedure
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
17
Use the ____ flowchart symbol to represent the condition in both the selection and repetition structures.

A) oval
B) rectangle
C) parallelogram
D) diamond
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
18
What is the value of the following expression: 9 * 2 - 8 > 5 + 2 / 2?

A) 10
B) 6
C) False
D) True
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following conditions will evaluate to True when the intPackages variable contains the value 100?

A) If intPackages = 100 Then
B) If intPackages 0 Then
C) If intPackages > 1 Then
D) All of the above would evaluate to True.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
20
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.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
21
Logical operators are sometimes referred to as ____ operators.

A) relational
B) arithmetic
C) comparison
D) Boolean
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
22
You use the ____ method to select all of the text contained in a text box.

A) All
B) SelectAll
C) AllText
D) GetAll
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
23
In the MessageBox.Show( text , caption , buttons , icon [, defaultButton ]) method, which of the following arguments controls the symbol appearing in the message box?

A) text
B) caption
C) buttons
D) icon
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
24
The Backspace key is represented by the ____ constant.

A) ControlChars.Back
B) ControlChars.BackSpace
C) ControlChars.Backspace
D) ControlChars.Backspc
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
25
A control's ____ event occurs each time the user presses a key while the control has the focus.

A) PressEnter
B) KeyEnter
C) KeyPress
D) FocusPress
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
26
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.
Which of the following If clauses would evaluate to True and apply the 10% discount for a commercial customer?

A) If strCustomer "C" AndAlso strMember "Y"
B) If strCustomer = "C" AndAlso strMember = "Y"
C) If strCustomer "R" OrElse strMember = "Y"
D) If strCustomer = "C" OrElse strMember = "Y"
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
27
A text box's ____ event occurs when the text box receives the focus.

A) Focus
B) It
C) Key
D) Enter
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
28
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?

A) text
B) caption
C) buttons
D) icon
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
29
Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed second?

A) ^
B) /
C) *
D) +
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
30
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 ____.

A) True
B) False
C) Yes
D) No
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
31
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.

A) KeyStruck
B) KeyEnter
C) KeyChar
D) KeyPress
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
32
Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed first?

A) ^
B) /
C) *
D) +
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
33
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 application needs to display a message box to remind the clerk to ask customers to join the Rental Rewards Program when they check out. This message box should only display if the customer is not currently in the program. Which of the following If clauses would evaluate to True and display the message box for the clerk?

A) If strMember "Y" Then
B) If strMember = "Y" Then
C) If strMember = "N" Then
D) a and c
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
34
The ____ method displays a message box that contains text, one or more buttons, and an icon.

A) MessageBox.Display
B) MessageBox.Group
C) MessageBox.Show
D) MessageBox.Output
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
35
Which of the following statements assigns the contents of the txtGrade control, in uppercase, to the strGrade variable?

A) If strGrade = txtGrade.Text.ToUpper Then
B) strGrade.ToUpper = txtGrade.Text
C) strGrade = txtGrade.Text.ToUpper
D) txtGrade.Text.ToUpper = strGrade
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
36
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 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
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
37
With the KeyPress event, use the e parameter's ____ property to cancel the key if it is an inappropriate one.

A) Check
B) KeyEnter
C) KeyChar
D) Handled
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
38
In the MessageBox.Show( text , caption , buttons , icon [, defaultButton ]) method, which of the following arguments controls the words appearing in the message box?

A) text
B) caption
C) buttons
D) icon
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
39
Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed last?

A) ^
B) -
C) >
D) AndAlso
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
40
You can use a(n) ____ to visually separate related controls from other controls on the form.

A) radio button
B) check box
C) group box
D) icon area
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
41
What is a group box and how is it used?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
42
Write an If statement that allows only numbers and a decimal place to be accepted.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
43
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.
If a customer decides to enroll in the Rental Rewards Program, the Member Information Form displays for the clerk to enter the membership data for the customer. Which of the following statements sends the focus to the txtFirstName control and highlights any text within it?

A) SelectAll(txtFirstName.text)
B) txtFirstName.SelectAll()
C) Focus(txtFirstName.text)
D) txtFirstName.Focus()
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
44
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.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
45
Problems - Correcting Code Errors
The following sample of code contains errors. Rewrite the incorrect statements to correct all errors.
An application needs to display the message "Please add water" when the amount of water has fallen below the safe limit. Rewrite the following If statement to correct all errors:
If intWaterLimit
lblWarning = "Please add water"
End If
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
46
Write a statement that changes the contents of the txtStatus control's text property to uppercase and stores it in the strStatus variable.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
47
Write an If clause to determine whether the dblTemp variable contains a number that is between 65 and 75.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
48
Write an If clause that will determine if the strColor variable contains either the string "red" or the string "blue".
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
49
Gino's Subs & Pies wants an application that allows a user to enter a customer's order total and address. When a customer purchases $30 or more of food, Gino's offers free delivery. The delivery fee for all other orders is $10. The calculation should display the total amount the customer owes, including any delivery fee. Draw the flowchart for the solution to this problem.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
50
Write an If clause to determine whether the user pressed the Backspace key.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
51
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
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
52
Write an If...Then...Else statement that displays the string "Balance Due" in the lblMessage control when the decBalance variable contains a number that is greater than 0; otherwise, assign the string "Thank you for your payment."
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
53
List the three most commonly used icons for display in a message box.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
54
What is a selection structure? What is the difference between a single-alternative and dual-alternative selection structure?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
55
Write a statement that creates a message box that displays an OK button, an Information icon, "Harris Pharmacy" in the title bar, and the message "Please enter a pickup time for your order".
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
56
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.

A) Boolean value
B) return value
C) selection structure
D) function
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
57
An application needs to calculate a discount for customers who are either preferred customers or senior citizens. Preferred customers have a discount code of  "P". Senior citizens have a discount code of "S". The discount code is stored in the strCode variable. Write an If clause to calculate a discount for all preferred members and senior citizens using the strCode variable.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
58
Write an If...Then...Else statement that assigns the number 2000 to the intBonus variable when the decSales variable contains a number that is greater than or equal to $50,000; otherwise, assign the number 500.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
59
Complete the chart shown below.
Complete the chart shown below.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 59 flashcards in this deck.