Question: 4. The High-Low Game test program below (a class exercise) allows only a single guess. The program needs to be run repeatedly until the number
4. The High-Low Game test program below (a class exercise) allows only a single "guess". The program needs to be run repeatedly until the number is found. % High-Low Game (Test Program) rand( seed,1234567) x = ceil( 1 00* rand); guess- inputf'Choose a number from 1 to 100: ; if guessx disp(TOO HIGH) else disp(RIGHT!) end Modify the program to allow you to continue to guess until the right number is entered. Keep track of the number of guesses you entered and display a message such after getting the right number. Descri as "You got the hidden number after 7 tries." ibe your steps in words (i.e. pseudocode), use your student ID number as the initial random number seed, instead of 1234567. Show the output for two runs, entering different guesses for Hint: One approach is to initially set a variable (usually called a "flag") to 1 and stay in a while loop, until the flag is cleared (to 0) when you get the number right. the second run. Altenatively, you can just reverse your ID digits
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
