C++ Program: [Switch] Percentage of marks and show grade

By: Prof. Dr. Fazal Rehman | Last updated: July 25, 2024

Write a C++ program to Show grades with marks percentage.

Example of all possible Outputs:

Example Output #1

Enter total marks obtained:
85
Grade: A

Example Output #2

Enter total marks obtained:
95
Grade: A+

Example Output #3

Enter total marks obtained:
70
Grade: B

Example Output #4

Enter total marks obtained:
60
Grade: C

Example Output #5

Enter total marks obtained:
45
Grade: D

Example Output #6

Enter total marks obtained:
30
Grade: F

Example#2

Let us see the C++ program to Calculate the percentage of marks and show grade using the switch statements. Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F

Flowchart of the program to Calculate the percentage of marks and show the grade

 

C++ program to Calculate the percentage of marks and show grade

Program in C++ to Calculate the percentage of marks and show the grade

Output

C++ program to show the grade

SFT (Shamil’s Flow Table )

Are you interested to Read about SFT(Shamil’s Flow Table)?

demo of c++ program to show the grade

C++ program to show grade after marks

C++ Program to input marks of subjects and show percentage, and grade without a switch statement

write-a-c-program-to-display-grade-of-a-student-using-if-else-statement-1

grade program c++T

Click Here Read More about this Shamil’s Memory Table of grade program

C++ program to find percentage of marks and show grade using if else statements

Output

Enter the marks of four subjects::
50
60
60
50

The Total_Marks marks = 220/400
The Average_Marks marks = 55
The Percentage = 55%
The Grade = ‘E’

——————————–

C++ program to find percentage of marks and show grade using Nested if else statements

Output

Enter the marks of four subjects::
40
40
60
60

The Total_Marks marks = 200/400
The Average_Marks marks = 50
The Percentage = 50%
The Student_Grade = ‘E’

——————————–

C++ program to find percentage of marks and show grade using User define function

Output

Enter the marks of four subjects::
40
40
60
60

The Total_Marks marks = 200/400
The Average_Marks marks = 50
The Percentage = 50%
The Student_Grade = ‘E’

Leave a Comment

All Copyrights Reserved 2025 Reserved by T4Tutorials