Hi my name is Chris and I am currently enrolled in CMIS102 class. I am really banging my head :@(on multiple occasions) with my latest assignment.
I have read every forum, book, and troubleshooting guide there is but nothing out there that has helped me to find the result or problem on why my code returns errors or 'bugs'.
#include <iostream>
using namespace std ;
int main()
{
// declaring variables:
int A, B, C, D, F;
char grades[5] = {'A', 'B' , 'C' , 'D' , 'F'};
// read in total score
cout << endl ;
cout << "Enter total score (float, must be <= 100) : " ;
cin >> score ;
// assign grade
if (score >= 90) then
grade = ‘A’ ;
else if (score >= 80)
set grade = ‘B’;
else if (score >= 70)
set grade = ‘C’;
else if (score >= 60)
set grade = ‘D’;
else
set grade = ‘F' ;
end if // end if score >= 55
end if // end if score >= 65
end if // end if score >= 75
end if // end if score >= 85
// display the result
cout << endl ;
cout << "Your grade for CMIS 102 is: " << grade << endl ;
return (0); // terminate with success
}
It comes back with the following errors...
error C2065: 'score' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'grade'
error C2065: '‘A’' : undeclared identifier (NOTE: it also says B, C, D, and F are undeclared as well)
It might be how I defined the variables but again, I am new to all of this and could use some guidance or help with this! It is due Sunday so I am hoping to have it complete by then
Thanks in advance