cout << "Enter the grade for Exam 1: ";
cin >> 100
//...
I assume what you want is to have those as the inputs, right? That doesn't work. You can't read in a number like that. What you're going to have to do is read in
a variable and when you
run the program the
variable is assigned the
number you type in (see below).
>> int exam 1
You can't do that either. Variables cannot have spaces in their name. int exam_1 is more what you want. Or you can do what you did later on in your code and call them exam1, exam2 etc.
int grade_1;
cout<< "Enter grade for exam: ";
cin> >grade_1;
cout<< "You entered: " << grade_1;
The rest looks OK.
Reputation Points: 453
Solved Threads: 57
Posting Virtuoso
Offline 1,873 posts
since May 2007