Computer Science, asked by Uzma2002, 1 year ago

answer it fast, it is a Java program

I want the correct answer plz

Attachments:

Answers

Answered by Anonymous
1
hey mate

here is your answer.
Attachments:

Anonymous: mention not
Anonymous: thanks
Uzma2002: well thanks again
Anonymous: any more help
Anonymous: regarding java program
Uzma2002: no not yet
Anonymous: whenever you have then text me
Anonymous: ok
Uzma2002: sure
Anonymous: : )
Answered by siddhartharao77
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!


siddhartharao77: :-)
Uzma2002: thnx
Anonymous: what if n=5
Anonymous: your program has a logical error
siddhartharao77: Small mistake..Corrected.. Thank you sir!
Anonymous: mention not .sir!!
Similar questions