Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objectives : using the pseudo-random number generator, repetition. Write a program that will help an elementary school student learn multiplication. Create a loop to do
Objectives: using the pseudo-random number generator, repetition.
Write a program that will help an elementary school student learn multiplication.
- Create a loop to do the following:
- Use rand() to produce two positive integers in the range 1 to 12. It should then type a question such as: How much is 6 times 7?
- Input the student's answer (you do not need to validate, assume a valid integer is entered.
- If the student answers -1, then exit the loop--the student is done.
- Check the student's answer.
- If it is correct, print Very good!
- Otherwise, the answer is wrong, so print No. Please try again. and then require the student try the same question again repeatedly until the student finally gets it right. (a nested loop).
- After the student answers the question correctly, loop back up to step 1 above and ask another multiplication question.
You must:
- Complete this assignment by the due date.
- Submit your work to the discussion board
- You will be randomly assigned TWO students to peer review immediately after the posting is due. Compile and run each program, then critique the work for:
- proper variable naming
- proper data types
- proper code indentation
- correctness of the algorithm
- each loop must have exactly one entry point, and one exit point. The use of the break statement to exit a loop is unacceptable.
IN C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started