Question
Crunchum Parking Lots, Inc charges different rates depending on the type of vehicle (C=Car, T=Truck, B=Bus) and length of time parked, as follows: Type First
Crunchum Parking Lots, Inc charges different rates depending on the type of vehicle (C=Car, T=Truck, B=Bus) and length of time parked, as follows:
Type | First Rate | Second rate |
Car | 1.25/hr first 2 hours | 1.50/hr after the first 2 hours |
Truck | 2.75/hr first 2 hours | 3.75/hr after the first 2 hours |
Bus | 9.50/hr for the first hour | 6.75/hr after the first hour |
Write a program to ask the user for the type of vehicle (C, T or B) and the number of hours parked and then print a parking invoice like: Crunchum Parking Lots, Inc. We usually find your vehicle! ============================= Vehicle Type: Car Time: 4 Hours Amount Due: $5.50
=============================
All times will be in whole hours, just use an int variable for hours.
I would use a char for Vehicle Type.
Run your program for the following three inputs and then two more with values of your choice, each time paste execution results at the end of your program as a comment.
Type Hours Parked
Car 7
Truck 10
Bus 8
Pseudocode:
If (Type of vehicle is C)
Vehicle Name is Car if(time<= limit) Amount = time * regular rate otherwise Amount = (limit * regular rate) + (time limit) * overtime rate
End if
Else If (Type of vehicle is T)
Same as above but for truck
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