QUESTION

Text
Image

Please use Java.

Given a day number (1-7), return the day of the week ("Sunday", "Monday", etc.). If an invalid day number is provided, return "Invalid".

Examples:

dayOfWeek(1) -> "Sunday"

dayOfWeek(4) -> "Wednesday"


X322: dayOfWeek Given a day number (1-7), return the day of the week ("Sunday", "Monday", etc.). If an invalid day number is provided, return "Invalid". Examples: dayofWeek(1) -> "Sunday" dayofWeek (4) $\rightarrow$ "Wednesday" Your Answer: Feedback 1 public String dayOfWeek(int dayNum) 2 \{ 8.01I don't know why I couldn't pass the hidden tests. Please help me. Thank you.


$8.0 /$ 10.0 $\begin{array}{ll}\text { Result Behavior } \\ \checkmark & \text { dayOfWeek(1) -> "Sunday" } \\ \checkmark & \text { dayOfWeek(4) -> "Wednesday" } \\ \checkmark & \text { dayOfWeek(7) -> "Saturday" } \\ \checkmark & \text { dayOfWeek(6) -> "Friday" } \\ \text { dayOfWeek(0) -> "Invalid" } \\ \text { hidden test(s) }\end{array}$

Public Answer

X8ENF2 The First Answerer