Question: QN . 5 . USING CONDITIONAL STATEMENTS, WRITE THE C PROGRAMMING CODE FOR THE FOLLOWING: a . A parking lot charges $ 2 for the

QN.5. USING CONDITIONAL STATEMENTS, WRITE THE C PROGRAMMING CODE FOR THE FOLLOWING:
a. A parking lot charges $2 for the first hour or part thereof and $1.50 for each additional hour or part thereof. Ask the user for the number of hours parked and calculate the total charge.
b. A library charges a fine for books returned late. For the first 5 days, the fine is $0.50 per day, for 6 to 10 days the fine is $1 per day, and above 10 days the fine is $2 per day. Ask the user for the number of days the book is late and calculate the fine.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!