Question: Write a m-script program using proper loop statement to perform the following tasks: (20 points) (a) Per-determine a random integer (rand_int) between [0-9] by the

Write a m-script program using proper loop statement to perform the following tasks: (20 points) (a) Per-determine a random integer (rand_int) between [0-9] by the program (hint: see documentation how to use randi () ). (b) Let the user guess a number (number) entered from the keyboard to be compared with the random integer (rand_int). (c) If the value of number matches the value of rand int, the program should display a message 'Bingo! The guessing is stopped by the program.' and terminate. (d) If the two values of number and rand_int are not matched, the program should ask whether the user wants to keep guessing by displaying Wrong guessing... try again? '. To continue guessing, a character 'Y' or 'y' should be entered from the keyboard; to stop guessing, a character N or n should be entered, and display The guessing is stopped by the user
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
