Sie sind auf Seite 1von 1

COMSATS Institute of Information Technology

CIIT, Defence Road, Off Raiwind Road, Lahore

CSD100 Fundamentals of Computer Programming


Assignment # 2 (Due on 7-11-2016)
Marks(5)
Instructions:

Assignment should be in hand written format.


Your code should contain following comments at the top
/*
Reg # :
Name:
Class:
Section:
*/

Question 1: A car park charges a Rs.30.00 minimum fee to park for up to 3 hours, and an additional
Rs. 5 for each hour or part hour in excess of three hours. The maximum charge for any given 24hour period is Rs.100.00. Assume that no car parks for more than 24 hours at a time.
Write a C program that will calculate and print the parking charges for each of 3 customers who
parked their car in the car park yesterday. The program should accept as input the number of hours
that each customer was parked, and output the results in a neat tabular form, along with the total
receipts from the three customers:

The program should use the function calculate_charges to determine the charge for each
customer.

Das könnte Ihnen auch gefallen