here is the test i made and it all checks out - now I need it to print out the grade made on the test after completion.
how do I do this?
Code:
#include <iostream>
using namespace std;
int main()
{
char Answer;
cout<<"you will be givin a short Exam of 5 questions \n"<<endl;
cout<<"Press enter after each question is answered \n"<<endl;
cout<<endl;
cout<<endl;
do
{
cout<<"Question 1"<<endl;
cout<<"where was Jason Born? \n\n"<<endl;
cout<<endl;
cout<<"(a) - Chicago?"<<endl;
cout<<"(b) - Atlanta?"<<endl;
cout<<"(c) - Pheonix?"<<endl;
cout<<"(d) - Tucson?" <<endl;
cin>>Answer;
cin.get();
if (Answer=='d')
{
cout<<"Thats Correct!"<<endl;
}
else
cout<<"Try Again"<<endl;
}while (Answer== 'a' || Answer=='b' || Answer=='c');
do
{
cout<<"Question 2"<<endl;
cout<<"Where did Jason go to highschool"<<endl;
cout<<endl;
cout<<"(a) Sahuaro ?"<<endl;
cout<<"(b) Sabino ?"<<endl;
cout<<"(c) Huntsville ?"<<endl;
cout<<"(d) Santa Rita ?"<<endl;
cin>>Answer;
cin.get();
if (Answer=='a')
{
cout<<"Right again!"<<endl;
}else
cout<<"try again"<<endl;
}while (Answer=='b' || Answer=='c' || Answer=='d');
do
{
cout<<"Question 3"<<endl;
cout<<"Where does Jason go to College"<<endl;
cout<<endl;
cout<<"(a) UAH ?"<<endl;
cout<<"(b) UNA ?"<<endl;
cout<<"(c) Alabama A&M ?"<<endl;
cout<<"(d) Athens Sate ?"<<endl;
cin>>Answer;
cin.get();
if (Answer=='c')
{
cout<<"Your on a roll!"<<endl;
}else
cout<<"try again"<<endl;
}while (Answer=='a' || Answer=='b' || Answer=='d');
do
{
cout<<"Question 4"<<endl;
cout<<"what is Jason's Major"<<endl;
cout<<endl;
cout<<"(a) Electrical Engineer ?"<<endl;
cout<<"(b) Civil Engineer ?"<<endl;
cout<<"(c) Computer Science ?"<<endl;
cout<<"(d) Mechanical Engineer ?"<<endl;
cin>>Answer;
cin.get();
if (Answer=='c')
{
cout<<"Yes-4 in a role!"<<endl;
}else
cout<<"try again"<<endl;
}while (Answer=='a' || Answer=='b' || Answer=='d');
do
{
cout<<"Question 5"<<endl;
cout<<"What floor is the computer science office on ?"<<endl;
cout<<endl;
cout<<"(a) 1st floor ?"<<endl;
cout<<"(b) 2nd floor ?"<<endl;
cout<<"(c) 3rd floor ?"<<endl;
cout<<"(d) Basement ?"<<endl;
cin>>Answer;
cin.get();
if (Answer=='c')
{
cout<<"Yes- you have completed this test!"<<endl;
}else
cout<<"try again"<<endl;
}while (Answer=='a' || Answer=='b' || Answer=='d');
return 0;
}