Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For this problem, you will use the MATLAB menu function to generate a menu of op

ID: 3675986 • Letter: F

Question

For this problem, you will use the MATLAB menu function to generate a menu of options. Type help menu at the MATLAB prompt to read about the menu command. Then execute the example given: K = menu('Choose a color',Red',Blue',Green*) Look at both the menu created and the value returned. Ask if you have any questions about how the menu function is working In Lab #4 we wrote a function called your share that computed the tip on a restaurant bill. You can use part of you're your share function to start this problem. Create a new function called restaurant that uses a menu to ask the user how their service was. There should be three options: Excellent, OK, or Not Good. Your function should assign tip percentages of 25,15, and 10 percent accordingly. You should output a message indicating the tip percentage as well as the output asked for in Lab #4. For this problem, think carefully about what needs to be inside the branch and what only needs to be done once. You should avoid repeating calculations multiple times whenever possible. Turn in your modified restaurant.m file.

Explanation / Answer

problem A:

for mat lab menu if e run, if e click red k will be asigned 1,if blue 2, green 3

i have opened menu.m , with edit menu.m and understood the logic

lab4:

clc;
clear all;
bill = input('please enter your bill amount: ');
disp('your bill was');
disp(bill);
grade=input('please enter service grade ::::::: exellent=25 ok=15 notgood=10 : ');
tip = (bill*grade)/100;
total=bill+tip;
disp('your final due should be');
disp(total);
  

out put:

please enter your bill amount: 244
your bill was
244

please enter service grade ::::::: exellent=25 ok=15 notgood=10 : 10
your final due should be
268.4000


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote