Exam 4: The Selection Structure

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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 < intWaterAmount Then lblWarning = "Please add water" End If

(Short Answer)
4.9/5
(42)

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.

(Short Answer)
4.9/5
(35)

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 <= 1750 OrElse decGPA >= 3.3 Then lblMessage.Text = "Not Accepted" Else lblMessage.Text = "Accepted" End If

(Short Answer)
4.9/5
(36)

If the intQuantity and decPrice variables contain the numbers 3 and 15.75,respectively,the condition If intQuantity > 0 AndAlso intQuantity < 10 OrElse decPrice > 20 will evaluate to ____.

(Multiple Choice)
4.8/5
(38)

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.

(Essay)
4.9/5
(43)

The expression 2 * 3 + 1 > 1 * 2 + 3 Or 7 + 2 < 4 + 1 evaluates to False.

(True/False)
4.7/5
(40)

Use the ____ flowchart symbol to represent the condition in both the selection and repetition structures.

(Multiple Choice)
4.7/5
(40)

List the three most commonly used icons for display in a message box.

(Short Answer)
4.9/5
(35)

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

(Multiple Choice)
4.8/5
(31)

In the MessageBox.Show (text,caption,buttons,icon[,defaultButton]) method,which of the following arguments controls the words appearing in the message box?

(Multiple Choice)
4.9/5
(46)

A text box's ____ event occurs when the text box receives the focus.

(Multiple Choice)
4.8/5
(40)

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.

(Multiple Choice)
4.8/5
(39)

Write an If clause to determine whether the dblTemp variable contains a number that is between 65 and 75.

(Short Answer)
4.8/5
(25)

Consider the expression 3 * 2 ^ 2 < 16 + 5 AndAlso 100 / 10 * 2 > 15 - 3.Which operation is performed second?

(Multiple Choice)
4.8/5
(36)

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?

(Multiple Choice)
4.8/5
(40)

The expression 12 > 0 AndAlso 12 < 10 * 2 evaluates to True.

(True/False)
4.8/5
(30)

Comparison operators are always evaluated after arithmetic operators in a conditional expression.

(True/False)
4.9/5
(33)

The diamond symbol is used in a flowchart for a calculation task.

(True/False)
4.9/5
(37)

You can include an identifying label on a group box by setting the group box's Identity property.

(True/False)
4.8/5
(40)

A control's ____ event occurs each time the user presses a key while the control has the focus.

(Multiple Choice)
4.9/5
(39)
Showing 41 - 60 of 60
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)