004-003-003
Array Elements: Getting Day of Week
Easy
Problem Description
Array Elements: Getting Day of Week
Learning Objective: Access elements using array indices
Get the day of week from an array that manages weekdays. Understand that array indices start from 0.
Input
Line 1: Day number (integer 0-6, 0=Sunday)
Output
Day number: [number]
Day: [day name]
Test Cases
※ Output examples follow programming industry standards
Input:
0
Expected Output:
Day number: 0 Day: Sunday
Input:
3
Expected Output:
Day number: 3 Day: Wednesday
Input:
6
Expected Output:
Day number: 6 Day: Saturday
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 6 free executions remaining
