Q16 A library charges a fine for every book returned late. For first 5 days the fine is 50 paise per day, for 6-10 days fine is one rupee per day and above 10 days fine is 5 rupees per day. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine appropriate message.
Program: 84
A library charges a fine for every book returned late. For first 5 days the fine is 50 paise per day, for 6-10 days fine is one rupee per day and above 10 days fine is 5 rupees per day. If you return the book after 30 days your membership will be cancelled. Write a c program to accept the number of days the member is late to return the book and display the fine appropriate message.
Output:
Enter the number of days: 5 You have to pay Rs. 2.50 fine. Enter the number of days: 10 You have to pay Rs. 10.00 fine. Enter the number of days: 13 You have to pay Rs. 65.00 fine. Enter the number of days: 31 Your membership would be canceled. You have to pay Rs. 155.00 fine.
| A Library charges a fine for every book returned late. For first 10 days the fine is Rs 5 per day,
for 11-20 days fine is Rs 10 per day, for 21-30 days fine is Rs 25 per day and after 30 days fine is Rs 50 per day. If a member does not return the book upto 60 days his membership will be cancelled. In order to continue his membership after 60 days, the member need to pay the regular fine plus an amount of Rs 2000 as Membership Renewal Charges. Write a program in C to accept the number of days the member is late to return the book and display the Total Amount to be paid with an appropriate message.