C++ declaring char for grade input using if then else statements

Hello,

I have to make code using if,then and else statements for grade input.

If the user inputs a,b,c, in both caps or lower case I need to cout "pass".

If the user inputs d,f also in caps or lower case I need to cout "fail".

If they input anything else I need to cout "grade not recognized".

Any help will be appreciated.
Here is a starting point:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <ctype.h>
#include <stdio.h>

using namespace std;

int main ()
{
  cout << "Enter your grade: ";
  char grade = cin.get();
  grade = tolower (grade);
  
  // put your logic here

  system ("pause"); // remove if you don't use Visual Studio
  return 0;
}
This sounds like homework.
Topic archived. No new replies allowed.