You are asked to write a program that will display a letter that corresponds with a numeric rating system. The program should use a switch statement. The numeric rating is stored in a variable named rate and rate may equal 1, 2, 3, or 4. The corresponding letter is stored in a variable named grade and grade may be A, B, C, or D. Which is the test expression for this switch statement

Answer :

MrRoyal

The switch statements are similar to the if statements in a computer program

The test expression for the switch statement is the variable rate

How to determine the test expression

From the question, we have the following highlights

  • The program displays a corresponding letter of a rate
  • The rating is stored in the variable rate

This means that, the numerical value of the variable rate would be tested and the corresponding letter would be printed

Hence, the test expression for the switch statement is the variable rate

Read more about computer programs at:

https://brainly.com/question/16397886

Other Questions