a fine is charged by a library for the books that are returned late. the following is the rate of the fine no. of days fine (in rs) first six days 5 seven to twelve days 8 above twelve days 10 design a program in Java to calculate the fine, assuming that the book is returned late by N days
Answers
Answered by
0
Answer:
n4
Explanation:
Answered by
0
the rate of the fine no. of days fine (in rs) first six days 5 seven to twelve days 8 above twelve days 10.
Explanation:
#include<stdio.h>
#include<conio.h>
int main()
{
int days;
float fine;
printf("Enter the number of days: ");
scanf("%d", &days);
if (days > 0 && days <= 5)
fine = 5 * days;
if (days >= 7 && days <= 12)
fine = 8 * days;
if (days > 12)
fine = 12 * days;
printf("You have to pay Rs. %.2f fine.", fine);
}
Similar questions