Advertisement
oona

emloyee check

Feb 28th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. public class employeeCheck {
  2.  
  3.     public static void main(String[] args) {
  4.         // TODO Auto-generated method stub
  5.        
  6.         int timeOfArrivalH; //the number of hours
  7.         int timeOfArrivalM; //the number of minutes
  8.        
  9.         System.out.println("Enter your time of arrival in hours");
  10.         timeOfArrivalH = TextIO.getInt();
  11.         System.out.println("Enter your minutes");
  12.         timeOfArrivalM = TextIO.getInt();
  13.        
  14.         if(timeOfArrivalH == 8 && timeOfArrivalM<45) //if your arrival was at less than 8:45 AM
  15.         {
  16.             early(); //arrival was early
  17.         }
  18.         if(timeOfArrivalH == 8 && timeOfArrivalM>=45) //if your arrival was at more than 8:45 AM
  19.         {
  20.             onTime(); //arrival was on time
  21.         }
  22.         if(timeOfArrivalH == 9 && timeOfArrivalM<=15) //if your arrival was at less than 9:15 AM
  23.         {
  24.             onTime(); // arrival was still on time
  25.         }
  26.         if(timeOfArrivalH == 9 && timeOfArrivalM>16) //if your arrival was at more than 9:15 AM
  27.         {
  28.             late(); // arrival was late
  29.         }
  30.        
  31.     } //main ends here
  32.     static void early()
  33.     {
  34.     System.out.println("You are early");
  35.     }
  36.     static void onTime()
  37.     {
  38.         System.out.println("You came on time");
  39.     }
  40.     static void late()
  41.     {
  42.         System.out.println("You are a minute or more late");
  43.     }
  44. } //program ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement