write a C++ program that accepts a student’s numerical grade, converts the numerical grade to an equivalent letter grade, and displays the letter grade.
1
Expert's answer
2016-04-13T09:59:05-0400
#include <iostream> using namespace std; int main() { int grade; cout << "Enter the numerical grade: "; cin >> grade; if (grade > 100 || grade < 0) { cout << "Invalid data" << endl; } else { cout << "The letter grade: "; if (grade > 89) { cout << "A"; } else if (grade > 79) { cout << "B"; } else if (grade > 69) { cout << "C"; } else if (grade > 59) { cout << "D"; } else { cout << "F"; } cout << endl; } system("pause"); return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment