Question: Code needs do work with Matlab. The user gets 3 tries to guess the lucky number (set the lucky number = 4) Write generalized code
Code needs do work with Matlab.The user gets 3 tries to guess the lucky number (set the lucky number = 4) Write generalized code (i.e. if I want to change the lucky number value, I change it at only one location within the program) The user is prompted to enter a number between 1 and 10 The entered number is compared to the lucky number, if it is equal to the lucky number, tell the user that they guessed the correct number, if not tell them to guess again. After each guess, tell them how many guesses they have left. Store all the user guesses in a matrix called 'user_guesses'. At the end of the game display the numbers guessed by the user. The user gets as many tries as required to guess the lucky number (set the lucky number =4) Write generalized code The user is prompted to enter a number between 1 and 10 The entered number is compared to the lucky number, if it is equal to the lucky number, tell the user that they guessed the correct number, if not tell them to guess again. When they eventually guess the correct number, tell them how many tries it took them to guess the correct number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
