Question: MATLAB PROGRAM. Write a program in a script file that calculates the cost of renting a car according to the following price schedule: Sedan SUV
MATLAB PROGRAM.
Write a program in a script file that calculates the cost of renting a car according to the following price schedule: Sedan SUV Duration of rentDailyFreeCost of DailyFree Cost of rate miles Additiona rate milesAdditional (per day) mile (per day) mile $79 80 S0.74 S0.64 S0.54 1-6 days S0.69S8480 S0.59 S0.49S64120 7-29 days S69100 S74100 30 or more days $59 120 The program asks 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 (rounded to cents) for the rent. 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
