Advertisement
hannan1144

problem5

May 27th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Salary{
  4.    
  5.     public static void main(String args[]){
  6.        
  7.         int workhour,salary;
  8.        
  9.         Scanner input= new Scanner (System.in);
  10.         System.out.println("please Enter work hour of employee");
  11.         workhour=input.nextInt();
  12.        
  13.         if(workhour<=40)
  14.         {
  15.             salary=450*workhour;
  16.             System.out.println("salary is "+salary);
  17.         }
  18.         else if(40<=workhour && 60>workhour)
  19.         {
  20.             salary=(40*450)+((workhour-40)*650);
  21.             System.out.println("salary is "+salary);
  22.            
  23.         }
  24.         else
  25.         {
  26.             salary=650*workhour;
  27.             System.out.println("salary is "+salary);
  28.         }
  29.     }
  30.    
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement