ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

C++ random numbers, inline function

by | Nov 30, 2023 | questions

Objective: learn how to:

— generate random numbers

— use inline function

— solve a real problem

Problem:

Write a program that will help an elementary school student learn multiplication. Use rand to produce two positive one-digit integers. The program should then output a question using the numbers, such as:

How much is 6 times 7?

where the first number must be less than or equal to the second. The student then types the answer. The program checks the student’s answer. If it is correct, print “Very good!” Otherwise, print “Sorry, you are wrong!” Then ask another multiplication question until the answer is -1.

Requirements:

You must use rand and srand functions to generate two integers each time and must write an inline function to compute the multiplication, though it is simpler without function.

2 Bonus Marks:

Use two integers to count the number of right and wrong answers. After the student has entered –1, print “You did X correct and Y wrong.” Furthermore, if the answer is wrong, print “No. Please try again.” Let the student try the same question repeatedly until the student gets it right. The number of wrong answers should be accumulated even for the same problem.

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!