hello ppl
im new to C++
i was making a small newbie math quiz..
and was wandering how can i make it that at the end it says how much u got out of 10 or watever
this is my code so far
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int Answer,toll,drive,bath;
{ cout<< "5+5=";
cin>> Answer;
if (Answer ==10)
{
cout<< "correct!\n";
}
else
cout<< "Incorrect\n"<< "Correct answer is 10\n";
}
system("pause");
{ system("cls");
cout<< "5x25=";
cin>> toll;
if (toll ==125)
{
cout<< "Well Done!\n";
}
else
cout<< "Wrong!\n"<< "Correct answer is 125\n";
}
system("pause");
{
system("cls");
cout<< "12x13=";
cin>> drive;
if (drive ==156)
{
cout<< "Good Work!\n";
}
else
cout<< "Not Right!\n"<< "Correct answer is 156\n";
system("pause");
}
system("cls");
cout<< "12+13x(13/6.5)=";
cin>> bath;
if (bath ==50)
{
cout<< "Good Work!\n";
}
else
cout<< "Wrong!\n"<<"Correct answer is 50\n";
system("pause");
{
system("cls");
if (Answer==10&&toll==125&&drive==156&&bath==50)
{ cout<< "\nGood Work\n 4/4 Correct\n";}
else
cout<< "Not 100%\n";
}
system("pause\n");
return 0;
}
i got it so it only says if u got all of them right or it says "not 100%"... also if i am doing somthing wrong please say so .
much appreciation :P