X926: Jeroo wakes up

A Jeroo named pat only wakes up and hops when it is time. Implement the following method called wakeUp() that takes pat, two integers, and a boolean value as parameters. If it is at or past pat's wake-up time, pat will hop() out of bed; otherwise, pat will remain still.

The first integer provided represents the day of the week encoded as 0 = Sun, 1 = Mon, 2 = Tue, ... 6 = Sat. The second integer represents the hour (0-23), and the boolean indicates if pat is on vacation. On weekdays, if the time is 7 (am) or later, pat should hop (out of bed). On weekends, pat sleeps in, and will hop out of bed at 10 or later. Unless pat is on vacation, in which case hopping out of bed begins at 10 on weekdays, and 12 on weekends.

Your Answer:

Feedback

Your feedback will appear here when you check your answer.