Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

**Need this answered immediately** C++ Math Game -Ask user to practice addition,

ID: 3835828 • Letter: #

Question

**Need this answered immediately**

C++ Math Game

-Ask user to practice addition, subtraction, multiplication, or division

-Once a skill is selected, user is asked for a range of numbers they wish to practice, inclusive to those numbers

-Numbers must be positive integers

-subtraction problems must result in positive answers

-Division problems must result in answers with a zero remainder

-User gets 1 point for correct answer (screen turns green), -1 for incorrect (screen turns red)

-incorrect answer displays the correct answer on screen

-The number of points should be displayed on the screen at all times.

-The three high scores (calculated by taking the number of correct answers divided by the elapsed time, correct problems per second) for each type of math operation should be stored in an external file.

-When someone creates a new high score and has chosen to exit the program, the program should ask the user for a user name.

-Then the high scores and user names must be displayed for 5 seconds before exiting the program.

-If the user hasn't beat one of the three high scores, the existing high scores and user names should be displayed for 5 seconds before exiting the program.

-There shall be no calculations or information asked for from the main function.

Explanation / Answer

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
int grade = 0;
int mathtype;
string name;
int gone rand();
int gtwo rand();
int answer;
int guess;


cout <<" WELCOME TO MATHTEST!!!"<<endl<<endl<<endl;
cout <<"Please enter your name: "<<endl;
cin >> name;
cout <<"and what grade are you in?"<<endl;
cin >>grade;

if (grade <4)
{
cout <<"You've selected grades k-3, what would you like to work on?"<<endl;
cout <<endl<<endl<<endl<<"Addition Division Multiplication Subtraction"<<endl;
cout << " 1 2 3 4 "<<endl<<endl<<endl;

cin >> mathtype;
}


else
{
cout <<"You've selected grades 4-6, what would you like to work on?"<<endl;
cout <<endl<<endl<<endl<<"Addition Division Multiplication Subtraction"<<endl;
cout << " 1 2 3 4 "<<endl<<endl<<endl;

cin >> mathtype;
}
//////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//////////////////////////////////////////
//////////////////////////
////////////
////

if (mathtype == 1)
{


cout<<"You chose Addition, here's question 1 of 5"<<endl;
gone + gtwo = answer;
cout<<"What is "<<gone<<"plus "<<gtwo<<endl;
cin>>guess;

if (guess == answer)
{
cout<<"That's right!"<<endl;
}

else
{
cout<<"Sorry that's not right, please guess again"<<endl;
}

}

if (mathtype == 2)
{
cout<<"You chose Division"<<endl;
}

if (mathtype == 3)
{
cout<<"You chose Multiplication"<<endl;
}

if (mathtype == 4)
{
cout<<"You chose Subtraction"<<endl;
}



system("PAUSE");
return EXIT_SUCCESS;
}