Question: Question 2 [ 1 2 marks ] You are tasked with developing a Java program that takes a numeric inputrepresenting the day of the week,

Question 2[12 marks]You are tasked with developing a Java program that takes a numeric inputrepresenting the day of the week, for example, 1 for Monday, 2 for Tuesday upuntil Friday and displays the corresponding day of the week in the consoleoutput. If the input is not within the range of 1-5 days, it displays "Invalid daynumber. In your implementation, you opted to use a switch statement.2.1 Why did you choose to use a switch statement in this scenario? (2 marks)2.2 Provide an appropriate source code for this project. (10 marks)

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 Programming Questions!