Code a private method called days0fTheWeek that takes in a parameter day as a String. Based on the input argument, the method should return the appropriate day (eg. Monday, Tuesday..etc) using a "switch case" control structure. If the day is not within the range, it should return an appropriate error message to the user and vice versa. The code conditions should demonstrate mutually exclusive and collectively exhaustive. The method should only use one return Statement. Example of output: days0fTheWeek ("2") will return " Tuesday " in terminal

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter7: Using Methods
Section: Chapter Questions
Problem 1CP
icon
Related questions
Question
Code a private method called days0fTheWeek that takes in a parameter day as a String. Based on the input
argument, the method should return the appropriate day (eg. Monday, Tuesday...etc) using a "switch case" control
structure. If the day is not within the range, it should return an appropriate error message to the user and vice
versa. The code conditions should demonstrate mutually exclusive and collectively exhaustive. The method should
only use one return statement.
Example of output:
days0fTheWeek("2") will return " Tuesday " in terminal
Transcribed Image Text:Code a private method called days0fTheWeek that takes in a parameter day as a String. Based on the input argument, the method should return the appropriate day (eg. Monday, Tuesday...etc) using a "switch case" control structure. If the day is not within the range, it should return an appropriate error message to the user and vice versa. The code conditions should demonstrate mutually exclusive and collectively exhaustive. The method should only use one return statement. Example of output: days0fTheWeek("2") will return " Tuesday " in terminal
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,