Answer to Question #312367 in Algorithms for KeKo

Question #312367

Create a program that prints A for exam grades greater than or equal to 90, B for grades in the range of 80 to 89, C for grades in the range 70 to 79, D for grades in the range 60 to 69 and F for all other grades. (DO NOT USE LOGICAL AND - && !!!!!))

1
Expert's answer
2022-03-16T07:08:24-0400
#include <iostream>
using namespace std;

int main() {
    int grade;
    char mark;

    cout << "Enter a grade: ";
    cin >> grade;

    if (grade >= 90) {
        mark = 'A';
    }
    else if (grade >= 80) {
        mark = 'B';
    }
    else if (grade >= 70) {
        mark = 'C';
    }
    else if (grade >= 60) {
        mark ='D';
    }
    else {
        mark = 'F';
    }

    cout << "Your mark is " << mark << endl;

    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS