Exam 5: More on the Selection Structure

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

Case-Based Critical Thinking Questions Case 1 - Horizon Cleaners Horizon Cleaners is an organic dry cleaner for clothing. The price for dry cleaning a shirt is $3.00, the price for pants is $3.50, and the price for dresses is $4.00. All clothes can be either washed or dry cleaned. Dry cleaned clothes can be hung or folded, and folded items cost an additional $0.50 per item. The secondary decision for assigning the fee for folded clothes is to determine ____.

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

C

If the txtBalance control contains the value $52, what value will the Decimal.TryParse(txtBalance.Text, decBalance) method return?

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

B

Colin is renting an automobile to take on vacation to the mountains. He would like to rent an SUV or a truck, but he would prefer an SUV for the covered storage. However, he does not know if there are any SUVs or trucks at the rental location where he lives. If there is not an SUV or a truck to rent, he will have to rent a car. He is going to call a rental agent and inquire about the available automobiles. Write an algorithm for this scenario.

Free
(Essay)
4.9/5
(42)
Correct Answer:
Verified

Call and ask the rental agent about the availability of automobiles
If an SUV is available
Rent the SUV
Else
If a truck is available
   Rent the truck
Else
   Rent the car
End If
End If

Case-Based Critical Thinking Questions Case 1 - Horizon Cleaners Horizon Cleaners is an organic dry cleaner for clothing. The price for dry cleaning a shirt is $3.00, the price for pants is $3.50, and the price for dresses is $4.00. All clothes can be either washed or dry cleaned. Dry cleaned clothes can be hung or folded, and folded items cost an additional $0.50 per item. The application needs to assign the fee for folded clothes. The primary decision for the scenario is to first determine ____.

(Multiple Choice)
4.8/5
(35)

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.

(Essay)
4.8/5
(34)

Ocean Resorts, Inc. pays a commission to employees based on an employee's sales and the number of years the employee has been with the company. Employee sales is stored in the decSales variable, and the number of years employed is stored in the intYears variable. The application should calculate the commission for an employee. The commission is 6% for sales of at least $100,000. If an employee's sales total is less than $100,000, the employee will receive a 3% commission if he or she has been with the company for two years or more. Otherwise, the employee does not receive a commission. Assign the commission to the decCommission variable. Write an If...Then...Else statement for the nested selection structure.

(Essay)
4.8/5
(28)

Programmers desk-check an algorithm to verify that it is not missing any steps, and that the existing steps are correct and in the proper order.

(True/False)
4.9/5
(24)

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.

(Essay)
4.8/5
(31)

The minimum number of radio buttons in a group is one.

(True/False)
4.9/5
(39)

You create the Random object by declaring it in a ____ statement.

(Multiple Choice)
4.9/5
(37)

Write a multiple-alternative selection structure that determines the shipping charge based on the total order amount entered by the user. The shipping charge is stored in the intShipCharge variable. The total order amount is stored in the decTotalOrder variable. The shipping charge is $9 for all orders under $25. The shipping charge is $8 for all orders of $25 to $50. The shipping charge is $7 for all orders where the total order amount is greater than $50. If the user does not enter a valid total order amount (less than 0), display "Please enter a valid amount." in the lblMessage control. Use the Select Case statement.

(Essay)
4.8/5
(37)

The ____ event occurs each time you select or deselect a check box or radio button.

(Multiple Choice)
4.9/5
(32)

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

(Multiple Choice)
4.8/5
(35)

Which of the following would be an appropriate use of a check box control?

(Multiple Choice)
4.8/5
(24)

Write a multiple-alternative selection structure that assigns an interest rate (.04, .05, .06) to the decInterestRate variable. The appropriate rate depends on the radio button selected by the user in the interface. The names of the radio buttons are rad4Rate, rad5Rate, and rad6Rate. Use the Select Case statement.

(Essay)
4.8/5
(37)

In a Case selection structure, each expression in an expression list is separated by a ____.

(Multiple Choice)
4.9/5
(39)

Case-Based Critical Thinking Questions Case 1 - Horizon Cleaners Horizon Cleaners is an organic dry cleaner for clothing. The price for dry cleaning a shirt is $3.00, the price for pants is $3.50, and the price for dresses is $4.00. All clothes can be either washed or dry cleaned. Dry cleaned clothes can be hung or folded, and folded items cost an additional $0.50 per item. The interface provides a text box for the user to enter the number of shirts being laundered. You want to make sure a string typed in by the user can be converted to a number to be used in the calculation for the total. Which of the following statements is valid?

(Multiple Choice)
4.7/5
(41)

Problems - Correcting Logic and Code Errors BrightStar Day School needs an application to calculate the total monthly tuition charge for students. The tuition schedule is shown below: Class Fee per Month Tuesday (T) and Thursday (R)   $135 Monday (M), Wednesday (W), and Friday (F)   $120 Students in the Tuesday and Thursday class can attend on Friday for an extra fee of $10 for each Friday attended. Rewrite the following algorithm to correct any logic errors: If TR class and attend on Friday Tuition = 135 + 10 Else If MWF Tuition = 120 End If End If

(Essay)
4.9/5
(38)

A selection structure that can choose from several alternatives is called a(n) ____ selection structure.

(Multiple Choice)
4.8/5
(30)

When a user selects a second CheckBox in a group, previously selected CheckBox items are deselected.

(True/False)
4.7/5
(30)
Showing 1 - 20 of 60
close modal

Filters

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