fork 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.  
  12. int a = 0, b=0;
  13.  
  14. //Boolean operator. == a = 4? = a is now = 4;
  15. //If conditional -- Goes into the brackets of the if, if the conditional is true.
  16. //False conditional using not equal to: != not equal to.
  17. //Tests: <, >, <=, >=
  18.  
  19. System.out.println("Enter the pay for employee 1: ");
  20. a = input.nextInt();
  21.  
  22. System.out.println("Enter the pay for employee 2: ");
  23. b = input.nextInt();
  24.  
  25. if (a > b){
  26. System.out.println("Employee 1 makes more than employee 2. ");
  27. }
  28. else if(a < b ){
  29. System.out.println("Employee 2 makes more than employee 1. ");
  30. }
  31. else if(a == b ){
  32. System.out.println("Employee 1 and 2 make the same amount. ");
  33. }
  34. else{
  35. System.out.println("Something went wrong with the input. ");
  36. }
  37.  
  38. //Allow input for 3 different employees, and calculate the taxes taken out of their check for each of them.
  39. //USA : 22% federal, 12% state, 5% Social security / medicare?
  40.  
  41.  
  42.  
  43.  
  44.  
  45. } //End main
  46. } //End class
  47.  
Success #stdin #stdout 0.07s 213760KB
stdin
2500
5100
stdout
Enter the pay for employee 1: 
Enter the pay for employee 2: 
Employee 2 makes more than employee 1.