Advertisement
jhnksr

Grades Checker v2

Sep 28th, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | Source Code | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     int g;
  7.     cout << "Enter your grade: ";
  8.     cin >> g;
  9.     if (g>100)
  10.     {
  11.         cout << "Please Enter a Valid Grade!";
  12.         }  
  13.     else if (g>=80)
  14.         {
  15.         cout << "Grade: A+";
  16.     }
  17.     else if (g>=70)
  18.     {
  19.         cout << "Grade: A";
  20.         }
  21.         else if (g>=60)
  22.     {
  23.         cout << "Grade: B";
  24.         }  
  25.         else if (g>=40)
  26.     {
  27.         cout << "Grade: C";
  28.         }  
  29.         else
  30.         {
  31.         cout << "Grade: F";
  32.     }
  33.     return 0;
  34.  
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement