Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class HelloWorld {
  4.     public static void main(String[] args) {
  5.  
  6.       Scanner scan = new Scanner(System.in);
  7. double input = scan.nextDouble();
  8. if (input<20000) System.out.printf("%.2f",0.);
  9. else if (input < 40000) System.out.printf("%.2f",input*0.1);
  10. else if (input<60000)System.out.printf("%.2f",input*0.2);
  11.     else System.out.printf("%.2f",input*0.3);}
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement