Question: 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

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"

Please use Java. Given a day number (1-7), return the day ofI don't know why I couldn't pass the hidden tests. Please help me. Thank you.

the week ("Sunday", "Monday", etc.). If an invalid day number is provided,

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) -> "Wednesday" Your Answer: Feedback 1 public String dayOfWeek(int dayNum) 2 { 8.0 / 10.0 3 8.0 / 10.0 Result Behavior dayOfWeek(1) -> "Sunday" dayOfWeek(4) -> "Wednesday" dayOfWeek(7) -> "Saturday" dayOfWeek(6) -> "Friday" dayOfWeek(O) -> "Invalid" hidden test(s)

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!