Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c Question 1(3 marks) Your little brother is taking a multiplication exam and needs your assistance. He wants you to ask him many questions

in c image text in transcribed
image text in transcribed
image text in transcribed
Question 1(3 marks) Your little brother is taking a multiplication exam and needs your assistance. He wants you to ask him many questions and examine his replies. But you have a lot of homeworks to accomplish, and you don't have time for that. Fortunately, you are a developer! as a result, you can delegate the task to the machine. Write a program that asks your brother to enter the number of questions he wants and enter the range of numbers he wants to practice, for example, he wants to practice multiplying numbers between 1 and 5. Then, as indicated below, ask him random questions, and evaluate if his answer is correct or incorrect. Enter the number of questions you want to practice: 4 Enter the range of numbers: 3 8 Question 1 What is the answer of 75 35 Congratulations! Your answer is right :) Question 2 What is the answer of 36 9 Your answer is wrong : the right answer is 18 Question 3 What is the answer of 32 Congratulations! Your answer is right :) Question 4 What is the answer of 6.7 42 Congratulations. Your answer is right :) Your score is 3/4 To produce a random question, generate two random integers within your brother's specified range. To do that you can use the following hint: To generate random number in the range [2,10] 1. #include 2. #include 3. int maino 4. { 5. srand(time(0)); 6. int lower = 2, upper = 10; 7. int num = (rand() % (upper - lower + 1)) + lower, 8. return 0; 9.} Question 2 (3 Marks) Ask the user to enter the width and the length of a rectangle, then draw that rectangle using #. Enter the width: 10 Enter the length: 5 # #en ELE Ett + 33 200 # # # # # # # # # # # # # ++ HHHF FS17 2215 Ett tttt 1

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

Distinguish between hearing and listening.

Answered: 1 week ago

Question

Use your voice effectively.

Answered: 1 week ago