Question: Further modify the program to display the spelling for a user-entered number between 0 and 99. Hint: To avoid having 100 cases, your program might

Further modify the program to display the spelling for a user-entered number between 0 and 99. Hint: To avoid having 100 cases, your program might first determine if the number is greater than twenty, using a switch a statement to display the spelling for the tens digit. This could then be followed with a switch statement to display the ones digits. Keep in mind that the values between 10 and 19 need special treatment. usrNum = input('Enter a number between 0 and 4: '); switch (usrNum) case 0 fprintf('%d is spelled zero ', usrNum); case 1 fprintf('%d is spelled one ', usrNum); case 2 fprintf('%d is spelled two ', usrNum); case 3 fprintf('%d is spelled three ', usrNum); case 4 fprintf('%d is spelled four ', usrNum); otherwise fprintf('Invalid number. Please try again. '); end

Programming Language is MATLAB

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!