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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started