This is a Brain Tester that I made.
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
for (int a=0,b=1;a!=b;)
{
cout << "This is a Brain Tester Program Made By Matthew Sedam.\n";
cout << "Select An Option.\n" << "1 - Multiplication\n2 - Division\n";
int select;
cin >> select;
system("cls");
if (select==1)
{
cout << "1. Facts or 2. Problems?\n";
int mselect;
cin >> mselect;
system("cls");
if (mselect==1)
{
int mf1,mf2,answer,wcount=0,rcount=0;
cout << "The Fact Range is 12X12.\n";
srand((unsigned)time(0));
cout << "You Will Be Tested 50 Times.\n";
system("pause >nul");
system("cls");
for (int a=0,b=50;a<b;a++)
{
mf1=(rand()%12)+1;
mf2=(rand()%12)+1;
cout << "What is " << mf1 << " X " << mf2 << ".\n";
cin >> answer;
if (answer!=mf1*mf2)
{
cout << "Wrong.\n";
system("pause >nul");
system("cls");
wcount++;
}
else if (answer==mf1*mf2)
{
cout << "Right.\n";
system("pause >nul");
system("cls");
rcount++;
}
}
cout << "You Got " << rcount << " Right. You Got " << wcount << " Wrong.\n";
system("pause >nul");
system("cls");
}
if (mselect==2)
{
int mp1,mp2,answer,wcount=0,rcount=0;
srand((unsigned)time(0));
cout << "You Will Be Tested 50 Times.\n";
system("pause >nul");
system("cls");
for (int a=0,b=2;a<b;a++)
{
mp1=(rand()%99)+1;
mp2=(rand()%99)+1;
cout << "What is " << mp1 << " X " << mp2 << ".\n";
cin >> answer;
if (answer!=mp1*mp2)
{
cout << "Wrong.\n";
system("pause >nul");
system("cls");
wcount++;
}
else if (answer==mp1*mp2)
{
cout << "Right.\n";
system("pause >nul");
system("cls");
rcount++;
}
}
cout << "You Got " << rcount << " Right. You Got " << wcount << " Wrong.\n";
system("pause >nul");
system("cls");
}
}
else if (select==2)
{
cout << "You Are Doing Problems.\n";
system("cls");
int df1,df2,wcount=0,rcount=0;
float answer;
cout << "The Range is 99/99.\n";
srand((unsigned)time(0));
cout << "You Will Be Tested 50 Times.\n";
system("pause >nul");
system("cls");
for (int a=0,b=50;a<b;a++)
{
df1=(rand()%99)+1;
df2=(rand()%99)+1;
cout << "What is " << df1 << " / " << df2 << ".\n";
cin >> answer;
if (answer!=df1/df2)
{
cout << "Wrong.\n";
system("pause >nul");
system("cls");
wcount++;
}
else if (answer==df1/df2)
{
cout << "Right.\n";
system("pause >nul");
system("cls");
rcount++;
}
}
cout << "You Got " << rcount << " Right. You Got " << wcount << " Wrong.\n";
system("pause >nul");
system("cls");
}
}
}