Computer Science, asked by shreyagupta6780, 10 hours ago

In a bank all employees are supposed to check in by 9:30. The check in time will be noted in 24 hrs format. Help the manager of the bank to find the number of employees who come in late . If one person is late display "1 employee is late" or if all the employees are late, display"All employees are late". Write a java program to implement the same

Answers

Answered by ItzMeSam35
1

import java.util.Scanner;

public class Arrival_Time

{

public static void main(String args[])

{

int employees;

double time;

Scanner sc = new Scanner(System.in);

System.out.print("Please enter total number of employees : "):

employees = sc.nextInt();

System.out.println();

System.out.println("Example : 9.30 for a.m. , 18.30 for p.m.");

System.out.println();

for (int i = 1; I <= employees; i++)

{

System.out.print("Please enter the employee's arrival time in 24 hours format :");

time = sc.nextDouble();

if (time <= 9.30)

{

System.out.println("Employee Is On Time");

}

else if (time > 9.30)

{

System.out.println("Employee Is Late");

}

}

sc.close()

}

}

Similar questions