Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program to calculate the parking fare for customers who park their cars in a parking lot when the following information is given:

image text in transcribed
Write a C program to calculate the parking fare for customers who park their cars in a parking lot when the following information is given: a) A character showing the type of vehicle: C for car, 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 vehicle entered the lot. d) An integer between 0 and 24 showing the hour the vehicle lest the lot. c) An integer between 0 and 60 showing the minute the vehicle left the lot This is a public lot. To encourage people to park for a short period of time, the management uses two different rates for each type of vehicle, as shown in Table 1. Vehicle First Rate Second Rate MOTORCYCLE CAR $0.00/hr first 3 hr $1.00/hr first 2 hr $2.00/hr first hr $1.50/hr after 3 hr $2.50/hr after 2 hr $3.50/hr after first hr 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 integers representing the type of vehicle and the entering and leaving hours and minutes. But these pieces of data must be input into the computer in a user-friendly way. In other words, the computer must prompt the user to enter each piece of data as shown below Type of vehicle? Hour vehicle entered lot (0-24)? 14 Minute vehicle entered lot (0-60)? 23 Hour vehicle left lot (0-24)? 18 Minute vehicle left lot (0-60%? 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago