fork(2) download
  1.  
  2. /**
  3.  *
  4.  * @author Damien Bell <SkyeShatter@gmail.com>
  5.  */
  6. import java.util.Scanner;
  7. class Jtutorial1 {
  8. public static void main(String args[]){
  9. Scanner input = new Scanner(System.in);
  10.  
  11. //pay -- double
  12. System.out.println("Enter a double: ");
  13. double pay = input.nextDouble();
  14.  
  15. if (pay <1000){
  16. System.out.println("Pay is less than 1000.");
  17. }
  18. else{
  19. if(pay >= 1000 && pay <1200){// ||-or &&- and
  20. System.out.println("Pay is less than 1200, And greater than 1000");
  21. }
  22. else{
  23. if(pay >= 1200 && pay <1500){
  24. System.out.println("Pay is less than 1500, And greater than 1200");
  25. }
  26. else{
  27. if(pay >= 1500){
  28. System.out.println("Pay is greater than 1500");
  29. }
  30. }
  31. }
  32. }
  33.  
  34. } //End main
  35. } //End class
  36.  
Success #stdin #stdout 0.08s 213888KB
stdin
1501
stdout
Enter a double: 
Pay is greater than 1500