about | help | code help+videos | done | prefs |
alarm
Given a day of the week encoded as 0=Sun, 1=Mon, 2=Tue, ...6=Sat, return a string of the form "7:00" indicating when the alarm clock should ring. Weekdays, the alarm should be "7:00" and on the weekend it should be "10:00". If the day is not an int from 0 to 6, return "error". You must use a switch statement to decide the alarm time. alarm(0) → "10:00" alarm(3) → "7:00" alarm(7) → "error" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy