Question: matlab! 1. Modification: Use a while loop to run the program 5 times to show results that duplicate the sample output shown below. The output

matlab!
1. Modification: Use a "while" loop to run the program 5 times to show results that duplicate the sample output shown below. The output is counted. See the session#. There are some special conditions required. Read the fine print. Using the loop, the program only has to be executed once, to achieve the shown results for: Class B, Class C and a Class D. Also use a switch in combination with an if/elseif/else structure. No simple if's are allowed in the program (use filename system: firstinitial _volvo lastname.m) 21. Write a program in a script file that calculates the cost of renting a car accord- ing to the following price schedule: Type of car Rental period 7-27 days 1-6 days 28-60 days Class B $27 per day Class C $34 per day Class D Class D cannot$276 for 7 days,$43$1,136 for 28 days, + $162 for 7 days, +$25 $662 for 28 days, + $23 for each additional day. for each additional day $204 for 7 days, $31$284 for 28 days, +$28 for each additional day. for each additional day be rented for for each additional day. $38 for each additional less than 7 days. day. The program asks the user to enter the rental period and the type of car. The program then displays the cost. If a period longer than 60 days is entered, a message "Rental is not available for more than 60 days" is displayed. If a rental period of less than 6 days is entered for class D, a message "Class D cars cannot be rented for less than 6 days" is displa Read the fine print. 1. Modification: Use a "while" loop to run the program 5 times to show results that duplicate the sample output shown below. The output is counted. See the session#. There are some special conditions required. Read the fine print. Using the loop, the program only has to be executed once, to achieve the shown results for: Class B, Class C and a Class D. Also use a switch in combination with an if/elseif/else structure. No simple if's are allowed in the program (use filename system: firstinitial _volvo lastname.m) 21. Write a program in a script file that calculates the cost of renting a car accord- ing to the following price schedule: Type of car Rental period 7-27 days 1-6 days 28-60 days Class B $27 per day Class C $34 per day Class D Class D cannot$276 for 7 days,$43$1,136 for 28 days, + $162 for 7 days, +$25 $662 for 28 days, + $23 for each additional day. for each additional day $204 for 7 days, $31$284 for 28 days, +$28 for each additional day. for each additional day be rented for for each additional day. $38 for each additional less than 7 days. day. The program asks the user to enter the rental period and the type of car. The program then displays the cost. If a period longer than 60 days is entered, a message "Rental is not available for more than 60 days" is displayed. If a rental period of less than 6 days is entered for class D, a message "Class D cars cannot be rented for less than 6 days" is displa Read the fine print
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
