Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Weekday Switch Challenge | Basic Types, Operations
Java Basics
course content

Course Content

Java Basics

Java Basics

1. Getting Started
2. Basic Types, Operations
3. Loops
4. Arrays
5. String

Weekday Switch Challenge

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Everything was clear?

Section 2. Chapter 7
toggle bottom row

Weekday Switch Challenge

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Everything was clear?

Section 2. Chapter 7
toggle bottom row

Weekday Switch Challenge

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Everything was clear?

Task

Write a program that takes an integer from 1 to 7 and prints the corresponding day of the week. Use a switch statement to solve the problem.

If the number is greater than 7 or less than 1, display an Error text.

Note

You should write a case for each day of the week from 1 to 7, starting with Monday. Replace ___ with the corresponding days, and also complete the code with cases for days 4, 5, 6, and 7 of the week.

Section 2. Chapter 7
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt