Java Bootcamp – Workbooks and Challenges
)}

Workbook 3.6

From Java Bootcamp Resources -> Module 1 -> 3\. Booleans and Conditionals, open Workbook 3.6.

Your Calendar


The code starts with a day your friend wants to hang out. There are also two print statements.

public class Calendar { public static void main(String[] args) { String day = "friday"; System.out.println("Hey, are you free on " + day + "? \n"); System.out.println("Hmm, let me check my calendar."); } }

>>Hey, are you free on friday?

>>

>>Hmm, let me check my calendar.

Task 1 - Check your calendar


Check that day against 7 days from your calendar.

  • case Monday, print:

Sorry, I have to stay at work late.

  • case Tuesday, print:

It looks like I have meetings all day.

  • case Wednesday, print:

I have a dentist appointment. Some other time!

  • case Thursday, print:

Sorry, thursday is date night!

  • case Friday, print:

I'm free!!

  • case Saturday, print:

I'm free!!

  • case Sunday, print:

I'm free!!

default:

that's not a day.

Run your code.


>>I'm free!!

Test cases


1. Change day to Saturday:

>>I'm free!!

2. Change day to Monday:

>>Sorry, I have to stay at work late.

Good Luck!


Feedback Summary
4.8
39 students
5

92%
4

3%
3

0%
2

0%
1

5%
Written Reviews
There are no written reviews yet.