here is the code now:-
BTW i got a friend to help me fix it but i have a new problem..
Code:
// questionaire.cpp
#include <iostream>
#include <windows.h>
#include <string.h>
using namespace std;
const int ANS = 80;
void fullscreen()
{
keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
}
class Questionaire
{
public:
void Showcreator()
{
cout << " **********[QUESTIONAIRE 1.0 by aBz]********** Score";
}
void Myansweris()
{
cout << "\n My Answer is:- ";
}
void Right()
{
cout << "\nCONGRATULATIONS! You got the right answer!";
cout << "\nPress any key to proceed.";
cin.ignore();
system("cls");
}
void Wrong()
{
cout << "\nWRONG!!!";
cout << "\nPress any key to try again.";
cin.ignore();
system("cls");
}
};
int main()
{
char choice = 'x';
char Answer[ANS];
Questionaire selection;
q1:
selection.Showcreator();
cout << "\n\nQ1. What is the capital of Turkey?";
selection.Myansweris();
cin.getline(Answer,ANS);
if( strcmp(Answer,"Ankara") == 0 || strcmp(Answer,"ankara") == 0 )
{
selection.Right();
}
else
{
selection.Wrong();
goto q1;
}
q2:
selection.Showcreator();
cout << "\n\nQ2. What is the capital of Egypt?";
selection.Myansweris();
cin.getline(Answer,ANS);
if( strcmp(Answer,"Cairo") == 0 || strcmp(Answer,"cairo") == 0 )
{
selection.Right();
}
else
{
selection.Wrong();
goto q2;
}
q3:
selection.Showcreator();
cout << "\n\nQ3. What is the capital of Iraq?";
selection.Myansweris();
cin.getline(Answer,ANS);
if( strcmp(Answer,"Baghdad") == 0 || strcmp(Answer,"baghdad") == 0 )
{
selection.Right();
}
else
{
selection.Wrong();
goto q3;
}
}
I want to put in a basic score system. what code do i use to add integers to a variable?