Multiple choice

Directions: Use the following program segment.

SELECT CASE Choice CASE 10 Price = Quantity * UnitPrice CASE 20 Price = Quantity * UnitPrice * 0.95 CASE 30 Price = Quantity * UnitPrice * 0.90 CASE ELSE PRINT "Invalid Choice." END SELECT

What happens if Choice equals 20?

  1. Price equals Quantity - UnitPrice.

  2. Price equals 95% of Quantity - UnitPrice.

  3. Price equals 90% of Quantity - UnitPrice.

  4. Invalid Choice is displayed.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When Choice equals 20, the CASE 20 block executes: Price = Quantity * UnitPrice * 0.95, which gives 95% of the original amount (a 5% discount).