Just picked up a beginners book on C++
so i'm pretty new at this.
trying to write a program to test what i have learned so far, but it's not coming out as i had hoped
so i'm hoping someone can help me out
constructive criticism welcomed
Here it is:
// Test #02 new version
// Title : The Question ?
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
int nAnswer;
int nAnswer2;
void displayExplanation()
{
//code starts here
cout << "The name of the game is\n"
<< "The Question\n"
<< "The Object of the game is\n"
<< "To answer all\n"
<< "The\n"
<< "Questions\n"
<< "(Correctly that is)\n"
<< " Press 1 for yes or 2 for no\n"
<< endl;
return;
}
void checker1(void)
{
if (nAnswer == 1)
{
cout << "That is correct"
<< endl;
}
else
{
cout << "Sorry try again :["
<< endl;
}
return;
}
void checker2(void)
{
if (nAnswer2 == 2)
{
cout << "That is correct"
<< endl;
}
else
{
cout << "Sorry try again :["
<< endl;
}
return;
}
int main(int nNumberofArgs, char* pszArgs[])
{
displayExplanation();
//
//
cout << "Question #01\n"
<< "George Washington was the first President\n"
<< endl;
cin >> nAnswer;
void checker1();
cout << "Question #02\n"
<< "The square root of 144 is 13"
<< endl;
cin >> nAnswer2;
void checker2();
system("PAUSE");
return 0;
}