#include <iostream> using namespace std; double result; double number1; double number2; double number3; double number4; double number5; string firstname; string lastname; int main() { cout<<endl; cout<<"Enter student's first name: "; cin>>firstname; cout<<"Enter student's last name: "; cin>>lastname; cout<<"Enter a score for the first test: "; cin>>number1; cout<<"Enter a score for the second test: "; cin>>number2; cout<<"Enter a score for the third test; "; cin>>number3 cout<<"Enter a score for the fourth test: "; cin>>number4; cout<<"Enter a score for the fifth test: "; cin>>number5; cout<<endl; cout<<"Your entered the following scores for student name "<<firstname<<" "<<lastname<<": "<<number1<<", "<<number2<<", "<<number3<<", "<<number4<<", and "<<number5<<". "<<endl; result = (number1+number2+number3+number4+number5)/5; //process cout<<endl; cout<<"Student name: "<<firstname<<" "<<lastname<<endl; cout<<"The Average is: "<<result<<". "<<endl; cout<<"Your grade is: "; if (result>=90 & result<100) { cout<<"A"<<endl; } if (result>=80 & result<90) { cout<<"B"<<endl; } if (result>=70 & result<80) { cout<<"C"<<endl; } if (result>=65 & result<70) { cout<<"D"<<endl; } if (result<=65) { cout<<"F"<<endl; } if (result>=97 & result<100) { cout<<"Your GPA is 4.0"<<endl; } if (result>=93 & result<96) { cout<<"Your GPA is 4.0"<<endl; } if (result>=90 & result<92) { cout<<"Your GPA is 3.7"<<endl; } if (result>=87 & result<89) { cout<<"Your GPA is 3.3"<<endl; } if (result>=83 & result<86) { cout<<"Your GPA is 3.0"<<endl; } if (result>=80 & result<82) { cout<<"Your GPA is 2.7"<<endl; } if (result>=77 & result<79) { cout<<"Your GPA is 2.3"<<endl; } if (result>=73 & result<76) { cout<<"Your GPA is 2.0"<<endl; } if (result>=70 & result<72) { cout<<"Your GPA is 1.7"<<endl; } if (result>=67 & result<69) { cout<<"Your GPA is 1.3"<<endl; } if (result>=65 & result <66) { cout<<"Your GPA is 1.0"<<endl; } if (result<65) { cout<<"Your GPA is 0.0" } return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:26:5: error: expected ‘;’ before ‘cout’ cout<<"Enter a score for the fourth test: "; ^ prog.cpp:40:11: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=90 & result<100) ^ prog.cpp:44:11: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=80 & result<90) ^ prog.cpp:48:11: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=70 & result<80) ^ prog.cpp:52:11: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=65 & result<70) ^ prog.cpp:60:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=97 & result<100) ^ prog.cpp:64:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=93 & result<96) ^ prog.cpp:68:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=90 & result<92) ^ prog.cpp:72:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=87 & result<89) ^ prog.cpp:76:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=83 & result<86) ^ prog.cpp:80:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=80 & result<82) ^ prog.cpp:84:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=77 & result<79) ^ prog.cpp:88:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=73 & result<76) ^ prog.cpp:92:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=70 & result<72) ^ prog.cpp:96:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=67 & result<69) ^ prog.cpp:100:15: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses] if (result>=65 & result <66) ^ prog.cpp:108:1: error: expected ‘;’ before ‘}’ token } ^
Standard output is empty