Convert the following switch structure into if-else statements.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section3.1: Assignment Operations
Problem 3E: (Conversion) Write an assignment statement to convert temperature in degrees Fahrenheit to degrees...
icon
Related questions
icon
Concept explainers
Question

Convert the following switch structure into if-else statements.

switch (mark/10)
case 10:
case 9:
case 8:
grade = "A+";
status = "Excellent";
break;
case 7:
grade = "A";
status = "Very Good";
break;
case 6:
grade = "B+";
status = "Good";
break;
case 5:
grade
= "C";
status =
break;
"Average";
case 4:
grade
= "D";
status =
break;
"Try harder";
default:
grade = "F";
status = "See you next semester";
Figure 1: switch Program Segment
Transcribed Image Text:switch (mark/10) case 10: case 9: case 8: grade = "A+"; status = "Excellent"; break; case 7: grade = "A"; status = "Very Good"; break; case 6: grade = "B+"; status = "Good"; break; case 5: grade = "C"; status = break; "Average"; case 4: grade = "D"; status = break; "Try harder"; default: grade = "F"; status = "See you next semester"; Figure 1: switch Program Segment
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT