Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: learn how to: -generate random numbers - solve a real problem Filename: lab9.cpp Problem: Write a program that will help an elementary school student

image text in transcribed
Objective: learn how to: -generate random numbers - solve a real problem Filename: lab9.cpp Problem: Write a program that will help an elementary school student to learn division with a remainder. Use rand to produce two positive integers, the first one as dividend has two digits (10-99) and the second one as divisor has one digit (2-9). The program should then output a question using the numbers, such as: What is 26 divided by 7? The student then types the answer with two numbers, the first one is quotient and the second one is remainder. The program checks the student's answer. If they both are correct, print "Very good!" Otherwise, print "Sorry, you are wrong!" Then present the correct answer and ask another division question until the answer is -1 for the quotient. Requirements: Use a do while loop. You must use rand and srand functions to generate two integers each time. Suggested screen design: What is 24 divided by 9? Enter quotient: 2 Enter remainder 6 ery good! uhat is 53 divided by 6? Enter quotient 4 Enter remainder 14 Sorry, you are wrong! The answer is: 53 divided by 6 is 8 with the remainder 5 What is 84 divided by 8? Enter quotient: -1 Goodbye Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions

Question

Describe the new structures for the HRM function. page 676

Answered: 1 week ago