@@ -0,0 +1,1161 @@
+package codingbat.logic1;%0A%0A// Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, %0A// and a boolean indicating if we are on vacation, %0A// return a string of the form %227:00%22 indicating when the alarm clock should ring. %0A// Weekdays, the alarm should be %227:00%22 and on the weekend it should be %2210:00%22. %0A// Unless we are on vacation -- then on weekdays it should be %2210:00%22 %0A// and weekends it should be %22off%22. %0A//%0A// alarmClock(1, false) = %227:00%22%0A// alarmClock(5, false) = %227:00%22%0A// alarmClock(0, false) = %2210:00%22%0A%0Apublic class AlarmClockTest %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A    AlarmClockTest test = new AlarmClockTest();%0A%0A    System.out.println(%22%3E%22 + test.alarmClock(1, false) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.alarmClock(5, false) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.alarmClock(0, false) + %22%3C%22);%0A  %7D%0A%0A  public String alarmClock(int day, boolean vacation) %7B%0A    String early = %227:00%22;%0A    String late = %2210:00%22;%0A    String off = %22off%22;%0A%0A    if (day == 0 %7C%7C day == 6) %7B%0A      if (vacation) %7B%0A        return off;%0A      %7D%0A      return late;%0A    %7D%0A    else if (vacation) %7B%0A      return late;%0A    %7D%0A    return early;%0A  %7D%0A%0A%7D%0A

add alarmClock task