answer it fast, it is a Java program
I want the correct answer plz
Attachments:
Answers
Answered by
1
hey mate
here is your answer.
here is your answer.
Attachments:
Anonymous:
mention not
Answered by
2
Sample Java Program:
import java.util.Scanner;
class Library
{
public static void main(String[] args)
{
int N;
double fine;
System.out.print("Enter the number of days: ");
Scanner demo = new Scanner(System.in);
N = demo.nextInt();
if(N <= 5)
{
fine = 0.4;
}
elseif(N >=6 && N <= 10)
{
fine = 0.65;
}
else
{
fine = 0.8;
}
System.out.println("The amount you have to pay: " +fine);
}
}
Output:
Enter the number of days: 6
The amount you have to pay: 0.65.
Hope it helps! ---------- Good Luck!
Similar questions