Menu
Question Index
...


Write a program to get all available half hour slots of the given employee.

Input (Employee) Output (List)
Mobeen [06:00 - 07:00, 13:00 - 13:30, 16:00 - 16:30, 18:30 - 20:00] [06:00 - 06:30, 06:30 - 07:00, 13:00 - 13:30, 16:00 - 16:30, 18:30 - 19:00, 19:00 - 19:30, 19:30 - 20:00]
Chaitanya [07:00 - 11:00, 13:00 - 14:00, 20:00 - 21:00] [07:00 - 07:30, 07:30 - 08:00, 08:00 - 08:30, 08:30 - 09:00, 09:00 - 09:30, 09:30 - 10:00, 10:00 - 10:30, 10:30 - 11:00, 13:00 - 13:30, 13:30 - 14:00, 20:00 - 20:30, 20:30 - 21:00]
Ram [01:00 - 02:00, 07:00 - 07:30] [01:00 - 01:30, 01:30 - 02:00, 07:00 - 07:30]
Amulya [07:00 - 07:30, 13:00 - 13:30, 15:00 - 15:30, 21:00 - 22:00, 23:00 - 23:30] [07:00 - 07:30, 13:00 - 13:30, 15:00 - 15:30, 21:00 - 21:30, 21:30 - 22:00, 23:00 - 23:30]

class AvailableSlotsOfAnEmployee

{    public static void main(String s[])
    {
        Employee mobeen = new Employee("Mobeen");
        mobeen.freeTimes.add("06:00 - 07:00");
        mobeen.freeTimes.add("13:00 - 13:30");
        mobeen.freeTimes.add("16:00 - 16:30");
        mobeen.freeTimes.add("18:30 - 20:00");
        System.out.println("All half hour slots in which 'Mobeen' is available : " + getAllHalfHourSlots(mobeen));

    }


public static List<String> getAllHalfHourSlots(Employee employee) {
//Write code here to get all half hour slots of a given employee.
}
}
class Employee {

String name;
ArrayList<String> freeTimes = new ArrayList<String>();

public Employee(String name) {
this.name = name;
}
}

Doubts

Problems

Topic: Locale Class In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App