Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class employeeCheck {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- int timeOfArrivalH; //the number of hours
- int timeOfArrivalM; //the number of minutes
- System.out.println("Enter your time of arrival in hours");
- timeOfArrivalH = TextIO.getInt();
- System.out.println("Enter your minutes");
- timeOfArrivalM = TextIO.getInt();
- if(timeOfArrivalH == 8 && timeOfArrivalM<45) //if your arrival was at less than 8:45 AM
- {
- early(); //arrival was early
- }
- if(timeOfArrivalH == 8 && timeOfArrivalM>=45) //if your arrival was at more than 8:45 AM
- {
- onTime(); //arrival was on time
- }
- if(timeOfArrivalH == 9 && timeOfArrivalM<=15) //if your arrival was at less than 9:15 AM
- {
- onTime(); // arrival was still on time
- }
- if(timeOfArrivalH == 9 && timeOfArrivalM>16) //if your arrival was at more than 9:15 AM
- {
- late(); // arrival was late
- }
- } //main ends here
- static void early()
- {
- System.out.println("You are early");
- }
- static void onTime()
- {
- System.out.println("You came on time");
- }
- static void late()
- {
- System.out.println("You are a minute or more late");
- }
- } //program ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement