Question: Assume you have access to an integer variable called dayOfTheWeek and a boolean variable called holiday, which is true when it is a holiday and

Assume you have access to an integer variable called dayOfTheWeek and a boolean variable called holiday, which is true when it is a holiday and false on normal days. Write Java code that prints Wake up at 7:00" on weekdays that are not holidays, and prints Sleep in!" on weekends and holidays. For the variable dayOfTheWeek, use this key:

1 = Monday

2 = Tuesday

3 = Wednesday

4 = Thursday

5 = Friday

6 = Saturday

7 = Sunday

Starting code:

//Assume these could have any value:

int weekday = 5;

boolean holiday = false;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!