Program in c++ language to find a grade of given marks using switch case. Take input from the user and print the grade of a student of the subject, for this problem use an absolute grading system, not a relative grading system. In console also print the message with a grade to appreciate a student.
Logic:-
Logic is very simple for grade program in C++ using a switch case. Taking input from the user(Input should be between range given 0 to 100 Else program play with you), as we know that grading system so divides the Mark by 10 and put the case condition in program See the below Explanation Step by step for better understanding.
Explanation:-
So first divide the mark by 10 so we can get a reminder and as you can see in the program we use case 4 to case 10. So if the remainder is between 4 to 10 our case performs the particular grade operation and display the result See the Step By Step Example for each case may be in this grade problem.
Case 1:- If the user is Over smart then there is a condition that if the mark given by the user is greater than 100 then our program displays the message "Don't Be Smart Enter your Marks Between Limit" or else perform the Else part.
Enter the Mark:- 1000
Output:- Don't Be Smart Enter your Marks Between Limit.
Case 2:- If the user is entering the marks between the 0 to 100 and then the particular grade portion will be executed and display the output in the Console screen.
Enter the Mark:- 95
Output:-Your Grade Is: A or Excellent
This operation performs the same for Grade B, C, D.
Case 3:- If Enter marks are not fulfilled the requirement of the case than the program will perform the default case.
Enter the Mark:- 25
Output:- You Grade Is: F or Fail
Output:
=========================================
This Is a Grade Checker Program
-----------------------------------
Enter The Marks Between 0 To 100:
=========================================
Enter The Mark: 500
Don't Be Smart Enter your Marks Between Limit
=========================================
This Is a Grade Checker Program
-----------------------------------
Enter The Marks Between 0 To 100:
=========================================
Enter The Mark: 90
=============================
Your Grade Is: A or Excellent
need an explanation for this answer? contact us directly to get an explanation for this answer