PLease answer this question
Attachments:
Answers
Answered by
2
Answer:-
This is the required program for this question.(Written in java)
import java.util.*;
class Library_Fine
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter number of days: ");
int d=sc.nextInt(), m=0;
if(d<=5)
m=d*40/100.0;
else if(d<=10)
m=d*65/100.0;
else
m=d*80/100.0;
System.out.println("Total fine in rupees is: "+m);
}
}
Answered by
3
Answer:
double f=0.0;
int d=Sc.nextInt(); //here u will input no. of days
if(d<=5)
f=0.40*d;
else if (d>6)&&(d<=10)
f=0.65*d;
else
f=0.80*d;
Similar questions