I'm trying to build a 10 question quiz and I'm designing it to where if you get the write answer it will move to the next question.
the problem I'm having is its saying (a,b,c,d,) is not initialized to anything when I clearly have initialized it as far as I need
Why is it telling me this?
Code:
#include <iostream>
using namespace std;
int main()
{
char Answer;
char a, b, c, d;
cout<<"you will be givin a short Exam of 10 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.sync();
cin.get();
if (Answer==d)
{
cout<<"Thats Correct!"<<endl;
}
else
cout<<"Try Again"<<endl;
}while (Answer==a,b,c);
return 0;
}
I plan to finish the whole thing and calculate the grade average at the end I just need to get this block right 4 now