Question: include proper comments Problem 4 (15 points): MATLAB script-4 The cost per mile for a rented vehicle is $1.00 for the first 100 miles, $0.85

include proper comments include proper comments Problem 4 (15 points): MATLAB script-4 The cost per

Problem 4 (15 points): MATLAB script-4 The cost per mile for a rented vehicle is $1.00 for the first 100 miles, $0.85 for the next 200 miles, and $0.65 for all miles in excess of 300 miles. Write a .m file that determines the total cost and the average cost per mile for a given number of miles (stored in a variable distance). Use the following fprintf statement as an output: "For a total distance of XX.X miles, the total cost is $XXX.XX and the average cost per mile is $X.XX." Sample Input/Output Enter the total miles traveled: 515 For a total distance of 515.0 miles, the total cost is $409.75 and the average cost per mile is $0.80

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!