Question: Write a programs to calculate the parking fare for etustomers who pack their cars in a parking lot when the following information is given a)


Write a programs to calculate the parking fare for etustomers who pack their cars in a parking lot when the following information is given a) A character showing the type of vehicle for en B for bus, M for motorcycle b) An integer between 0 to 24 showing the hour the vehicle entered the lot c) An integer between 0 and 60 showing the minute the velucle entered the lot d) An integer between 0 and 24 showing the hou the velucle leat the lot +) An integer between 0 and 60 showing the mintite the veluicle left the lot This is a publie tot To encourage people to park for a short period of time, the management uses two different rates for each type of velucle, as shown in Table 1 Vehicle MOTORCYCLE First Rate $0.00/hr first 3 hr 51.00/hr first 2 hr 52.00/hr first but Second Rate $1.50/hr after hr $2 50/hr after 2hr $3.50/lu after first lu CAR BUS Table 1: Rates for Parking No vehicle is allowed to stay in the parking lot later than midnight, it will be towed away The input data consist of a character and a set of four integets representing the type of velucle and the entering and leaving hours and minutes. But these pieces of data must be input into the computer in a set-friendly way. In other words, the computer must prompt the user to enter each piece of data as shown below Type of velucle? Hour vehicle entered lot (0-24)? Minute vehicle entered lot (0-60)? Hour vehicle left lot (0-24)? Munte velicle left lot (0-60 14 23 18 5 Foged A well-structured program design is required. Run your program six time with the data stown in Table 2 Test Type Hour in Minute In Minute Out Hour Out 14 1 12 40 22 B 8 20 40 2 3 8 3 M 2 0 59 4 12 40 16 5 B 8 20 14 20 6 M 0 12 0 Table 2 Test Data 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
