QuestionQ156

Using Operators and Decision Constructs

Given:

Question Image

Which statement is correct?

  • A The program executes and prints: 500.0
  • B Commenting line 16 enables the program to print: Thank You! 500.0
  • C Commenting line 13 enables the program to print: Thank You! 500.0
  • D The program executes and prints: Thank You! 500.0
Explanation

A continue statement is permitted only within a loop. Removing that statement allows case "2" to set discount to 500.0 and fall through to default, printing Thank You!; the subsequent print statement outputs 500.0.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!