ofekkfir

exercise 9

Oct 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.32 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class targil9
  3. {
  4.     static Scanner reader = new Scanner (System.in);
  5.  
  6.     /**
  7.      * @param args
  8.      */
  9.     public static void main(String[] args)
  10.     {
  11.         int salary_manager = 15000;
  12.         int salary_employee = 10000;
  13.         int mang_emp , days;
  14.        
  15.         System.out.println("Enter 1 if your a manager or 2 if your a employee");
  16.         mang_emp = reader.nextInt();
  17.         System.out.println("Enter days you have been missing");
  18.         days= reader.nextInt();
  19.         if (mang_emp == 1 )
  20.         {
  21.             if (days == 0 )
  22.             {
  23.                 System.out.println ("Your salary is " + salary_manager*1.15 );
  24.             }
  25.             if (days == 1 )
  26.             {
  27.                 System.out.println ("Your salary is " + salary_manager*1.07 );
  28.             }
  29.             if (days == 2 )
  30.             {
  31.                 System.out.println ("Your salary is " + salary_manager*1.05 );
  32.             }
  33.             if (days >=3 )
  34.             {
  35.                 System.out.println ("Your salary is " + salary_manager);
  36.             }
  37.            
  38.         }
  39.         if (mang_emp == 2)
  40.         {
  41.             if (days  == 0)
  42.             {
  43.                 System.out.println ("Your salary is " + salary_employee*1.10 );
  44.             }
  45.             if (days == 1)
  46.             {
  47.                 System.out.println ("Your salary is " + salary_employee*1.05 );
  48.                
  49.             }
  50.             if (days == 2)
  51.             {
  52.                 System.out.println ("Your salary is " + salary_employee*1.03 );
  53.             }
  54.             if (days >= 3)
  55.             {
  56.                 System.out.println ("Your salary is " + salary_employee );
  57.             }
  58.             }
  59.         }
  60.        
  61.        
  62.     }
Add Comment
Please, Sign In to add comment