Question: Write a function to ask the user for a number within a given range. The function has two input arguments which are the lower and
Write a function to ask the user for a number within a given range. The function has two input arguments which are the lower and upper limits of the number. The function returns the correct user entered number as the output argument. Inside the function, we ask the user to type of number within the range. If the number is outside the range, the function keeps asking until the user provides a correct number. Specific Requirements: Your function should match exactly the outputs below when tested in the command window. You should use sprintf to create a customized prompt message for input based on the value of a variable. Below is an example to create a customized prompt message for input function: NAME 'John'; MSG sprintfHi s where are you from? NAME; NUM inputMSG Do not use break or while true in your code. Name your function using your last name followed with HWQ For example, if your last name is Lewis, your function should be named as LewisHWQ Submit the m file for your function. Do NOT copy your code to word file.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
