Question: Solve using MATLAB Most major airports have separate lots for long-term and short-term parking. The cost to park depends on the lot you select, and

Solve using MATLAB

Most major airports have separate lots for long-term and short-term parking. The cost to park depends on the lot you select, and how long you stay. Consider this rate structure.

Long-Term (Economy) Parking

The first hour is $2.00, and each additional hour or fraction thereof is $1.00 (i.e., always round time up to next hour using MATLAB ceil(x), floor(x) or round(x))

Daily maximum $10

Weekly maximum $60.00

Short-Term Parking

The first 30 minutes are $2.00 and each additional 20 minutes or fraction thereof is $1.00 (i.e., always round time up to next 20 minute using MATLAB ceil(x), floor(x) or round(x))

Daily maximum $32.00

Write a function that asks the user to input the following:

Which parking lot are you using? 'S' for short term parking, or 'L' for long term parking

How many weeks, hours, days, and minutes did you park?

When calling the function, have the users input the number of hours, days, and minutes that they parked.

Your program should then calculate the the total parking bill.

Make use of the fprintf command to indicate the duration of the stay (Weeks, Days, Hours, Minutes) and the total cost to the nearest cent.

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!