Design and implement a program (name it GradeReport) that uses a switch statemen
ID: 3746308 • Letter: D
Question
Design and implement a program (name it GradeReport) that uses a switch statement to print out a message that reflect the student grade on a test. The messages are as follows: For a grade of 100 or higher, the message is ("That grade is a perfect score. Well done.") For a grade 90 to 99, the message is ("That grade is well above average. Excellent work.") For a grade 80 to 89, the message is ("That grade is above average. Nice job.") For a grade 70 to 79, the message is ("That grade is average work.") For a grade 60 to 69, the message is ("That grade is not good, you should seek help!”) For a grade below 60, the message is ("That grade is not passing.”) Organized your output following these sample runs. Sample run 1: You entered 100 That grade is a perfect score. Well done. Sample run 2: You entered 75 That grade is average. Sample run 3: You entered 55 That grade is not passing. Design and implement a program (name it GradeReport) that uses a switch statement to print out a message that reflect the student grade on a test. The messages are as follows: For a grade of 100 or higher, the message is ("That grade is a perfect score. Well done.") For a grade 90 to 99, the message is ("That grade is well above average. Excellent work.") For a grade 80 to 89, the message is ("That grade is above average. Nice job.") For a grade 70 to 79, the message is ("That grade is average work.") For a grade 60 to 69, the message is ("That grade is not good, you should seek help!”) For a grade below 60, the message is ("That grade is not passing.”) Organized your output following these sample runs. Sample run 1: You entered 100 That grade is a perfect score. Well done. Sample run 2: You entered 75 That grade is average. Sample run 3: You entered 55 That grade is not passing. Design and implement a program (name it GradeReport) that uses a switch statement to print out a message that reflect the student grade on a test. The messages are as follows: For a grade of 100 or higher, the message is ("That grade is a perfect score. Well done.") For a grade 90 to 99, the message is ("That grade is well above average. Excellent work.") For a grade 80 to 89, the message is ("That grade is above average. Nice job.") For a grade 70 to 79, the message is ("That grade is average work.") For a grade 60 to 69, the message is ("That grade is not good, you should seek help!”) For a grade below 60, the message is ("That grade is not passing.”) Organized your output following these sample runs. Sample run 1: You entered 100 That grade is a perfect score. Well done. Sample run 2: You entered 75 That grade is average. Sample run 3: You entered 55 That grade is not passing.Explanation / Answer
#include<stdio.h>
#include<conio.h>
void main()
{
int marks;
clrscr();
printf("Enter the marks of the students");
scanf("%d",&marks);
switch(marks)
{
case 100 ... 300:
printf("That grade is a perfect score. Well done.");
break;
case 90 ... 99:
printf("That grade is well above average. Excellent work");
break;
case 80 ... 89:
printf("That grade is above average. Nice job.");
break;
case 70 ... 79:
printf("That grade is average work.");
break;
case 60 ... 69:
printf("That grade is not good, you should seek help!");
break;
default:
printf("That grade is not passing.");
break;
}
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.