Question: Complete the coding for the Guessing Game exercise. In addition, add lines to your guessing game to keep track of the number of guesses it
Complete the coding for the Guessing Game exercise. In addition, add lines to your guessing game to keep track of the number of guesses it took to get the right answer. Also, add a subfunction with input parameters to allow the user to pick a new range of integers from which to guess. You need to paste the code below along with the screenshots for showing the results.
The code attached is what I have so far, but it doesn't work correctly, and I do not know what I'm doing wrong. This is in MATLAB.
Editor - UAISE212\Guessing_Game_Code.m Guessing_Game_Code.m x + 0 0 0 0 4 - 5 - function Guessing_Game_Code () secret=round ((100-1) *rand() +1); guess=input('Enter a guess: '); 7 - - 0 0 9 10 11 - 12 13 14 15 - 16 - 17 - II i III while guess = secret if guess > secret disp('Too high.'); elseif secret
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
