Question: Matlab Question. Would like detail Hws Problem 4 (30 points) The price for renting a car at a car rental company is according to the
Hws Problem 4 (30 points) The price for renting a car at a car rental company is according to the following schedule: SUV Sedan Daily Free Cost of Daily Free. Cost of Duration of rent rate miles Additional rate miles Additional (per day) mile (per day) mile 1-6 days S79 80 $0.69 $84 80 S0.74. 7-29 days S69 100 $0.59 $74 100 $0.64 30 or more days S59 120 S0.49 $64 120 50-54 Write a MATLAB program in a script file that calculates the cost of renting a car based on the shown price schedule. The program must ask the user to enter the type of car (Sedan or SUV), the number of days, and the number of miles driven. The program then displays the cost Grounded to cents for the rent in a sentence that reads The cost of the rent is XXX where XXX is the cost value in Run the program three times for the following cases: (a) Sedan, 10 days, 769 miles. (b) SUV, 32 days, 4,056 miles. (c) Sedan, 3 days, 511 miles. car (Sedan/SU with Hint: Use a switch-case structure for the type of the miles. nested alternative if structure for the number of days and Use fprintf to display the text and data. The data should be displayed in f format with two decimal digits
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
