I'm creating this program to test the user on their
math skills on multiplication, addition, subtraction, and
division. The problem I'm having is refrencing functions
from other functions, here is a skeletal esample of my
code:
If you need more information PLEASE!!!! EMAIL ME!!
so that I could send you a .txt file of my code. Thanks
for your help.
-------int main()
\\ inside the main function there are variables
output to let the user know he has to enter
options for the difficulty level
Random_num() \\ I put the function there because
that is where the user will be
entering there choice.
\\ Then is asks for the user to pick what kind
of math problem they would like.
cin >> userchoice \\ that is the variable for
the "Choice" varible in the
Calculation function.
\\ while the counter is not 5 continue loop.
point += Calculation ( userchoice )
\\ after the while loop has been finished it
calculates the user's points and tells you
did bad or good.
------Random_num ( int )
cin >> choice \\ this is the varible for the
switch statement.
\\ I have a switch statment that gives the user
a choice of the intensity of the math problem
1 being easy, 2 being medium, and 3 being hard.
so, EASY SHOULD BE A = RAND() % 9
MEDIUM SHOULD BE A = RAND()% 99
HARD SHOULD BE A = RAND()% 999
the return would be difficulty
return DIFFICULTY;
-----Calculation ( int )
number one = Random_num () \\ THIS IS WHERE i'M HAVING
TROUBLE. I NEED
number two = Random_num () THE RETURN OF Random_num()
to be refrenced to number
one and number two.
\\ there is also a switch statment that gives the
user the option to pick which type of math
problem. 1 for additcion, 2 for subtraction
3 for multiplication, and 4 for division.
Also, in each case of the switch statement --
Choice, the user enters his/her answer.
\\ INSIDE EACH
EACH CASE, OF THE SWITCH, STATEMENT INCLUDES THE
VARIBLE THAT CALULATES THE ANSWER. SO,
case add : Right_answer = number one
+ number two;
\\ if the user gets the answer right the computer
increments a point for the user, so the
return is point.
return point;