C program to compute parking fare for customers

Assignment Help C/C++ Programming
Reference no: EM1366976

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 and T for truck
b) An integer between 0 and 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 left the lot
e) 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 below:

Vehicle First Rate Second Rate
Car $0.00/hr first 3 hours $1.50/hr after 3 hours
Truck $1.00/hr first 2 hours $2.30/hr after 2 hours
Bus $2.00/hr first 1 hour $3.70/hr after 1 hour

You can assume that all vehicles will not be in the parking lot any later than midnight.

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.

Reference no: EM1366976

Questions Cloud

Component of the health care continuum : use the information to allocate the resources and shape regulations aimed at this component of the health care continuum.
Explain diffie-helman protocol for sending message : In Diffie-Helman protocol, the common modulus is selected as n = 19 and the generator g is chosen to be 2. Alice and Bob select numbers 6 and 10 privately.
Determine the annual net cash cost of borrowing : Ron's Pharmacy has collected $600 in sales taxes during the March. If sales taxes must be remitted to state government monthly, what entry will Ron's Pharmacy create to demonstrate the March remittance?
Pay-for-performance programs : Pay-for-performance programs use financial incentives to enhance quality of health care and/or contain costs. What are the pros and cons of this approach?
C program to compute parking fare for customers : Write C program to compute parking fare for customers who park their cars in parking lot when following information is provided: A character showing type of vehicle: C for car, B for bus and T for truck
Law of supply-sunrise surf shop : Sunrise Surf Shop is willing to produce 30 surfboards in the month if it can sell each board for $300. If it can receive $500 for each board, the shop is willing to manufacture 70 surfboards.
Ethical concerns health care management : Find out what ethical concerns health care management or administrator professionals have to contend with resulting from the supply and demand of insurance.
Determining effect of subsidy : What effect will each of the following have on the supply of automobile tires?
How cost of box is evaluated in lookup table : Cost of box is determined by looking up value in a lookup table. Shipping cost also is determined by looking up value in a lookup table. Use table at cells H23:J28 with a VLOOKUP function to determine cost of a box.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Prepare a program that uses the pthread library

Prepare a C/C++ program that uses the PTHREAD library to create threads and mutexes to synchronize them.

  Develop a simple poker game

Develop a simple poker game

  Write c program that forks two child processes

Write a C program that forks two child processes. The parent process will print all prime numbers up to 229, the first child process will print the first 50 Fibonacci numbers.

  Write a matrix multiplication program

Write a C++, matrix multiplication program which you can instrument to monitor and measure execution time as a function of problem size. Make sure it works in Microsoft Visual Studio.

  Programmingto compute the volume of water in the cubic feet

Write down an algorithm (Programming in C) in order to compute the volume of water in the cubic feet, flowing through a pipe of diameter d in feet, having a velocity of v feet per second.

  Prepare a program for a retail-mart company

Prepare a program for a company Retail-Mart.

  Prepare an arbitrary sinusoidal waveform

Create a program to compute the derivative of an arbitrary input function, with arbitrary duration and arbitrary limits

  Write song playlist class-object-oriented design principles

Write a song playlist class in C++ called "PlayList" using object-oriented design principles. The playlist should support the following ADT.The implementation should be based on an array of strings to store the song titles.

  Program to next the loops in either direction

You can write your program to next the loops in either direction, that is, process row-by-row or column-by-column. Explain which way you would choose to process the data.

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Pros and cons of choosing two servers

Classify the two alternatives in terms of what type of application architecture they use. b. Outline the pros and cons of the two alternatives and make a recommendation to Fred about which is better.

  Operating system and cpu scheduling

Operating System and CPU Scheduling

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd