Question: How would i be able to use If/else statements on this code for it to give me a letter grade at the end? #include #include
How would i be able to use If/else statements on this code for it to give me a letter grade at the end?
#include#include using namespace std; int main() { double grade1, grade2, grade3, grade4, total; cout << "please enter the first grade : "; cin >> grade1; cout << "Please enter the second grade : "; cin >> grade2; cout << "Please enter the third grade : "; cin >> grade3; cout << "Please enter the fourth grade : "; cin >> grade4; total = (grade1 + grade2 + grade3 + grade4) / 4; cout << "The average grade is : " << setprecision(6) << total << endl; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
