Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use matlab. Thanks 3- It will be important to understand how random numbers are generated using the rand) function. You will also need to

Please use matlab. Thanks image text in transcribed
3- It will be important to understand how random numbers are generated using the rand) function. You will also need to have a basic understanding of a while or for loop. You are to write a program in which the user tries to guess which number (from 0 to 99, inclusive) that the program generates, based on the rand() function. First the program asks the user to guess which number will be generated, and if the user is correct, it prints "Good guess! and if the user is incorrect, it prints "Sorry too high or too low (depend of the case), try again" Some other specifications: 1. The program should repeatedly ask the user for a guess and generates the outputs "Number picked:"followed by the number, and the statements as to whether it was correct or not, too high or too low. If the user enters a number of 0 or less, the program should print "Goodbye" and exit. 2. mber greater than 99, the program should output "Number too high, If the user enters a nu guess again!" and then ask for another number. When the answer 99 and ask for a new guess. 3. 4. s correct the program must generate a new random number between 1 and

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

Students also viewed these Databases questions