WAP to calculate the fine by accepting number of days after which the book is returned PRO- school book library charges a fine for books returned late as given below.
First 7 days |
No fine |
Next 5 days |
Rs 1.2/ day |
Next10 days |
Rs1.75/day |
Input=15
Output=11.25
Explanation: As for first 7 days there's no fine so the value will be zero(0) and for
next 5 days there's a fine charge of Rs1.2/day so the value will be (1.2*5=6.0) and now for remaining
3 days there's a fine charge of Rs1.75/day so the value will be (1.75*3= 5.25) hence the final value for 15 days is (6.0+5.25=11.25)
Published By : Sunita Chhetry