Question: a ) Write a method called GetDayOfMonth ( ) which prompts and accepts the day of the month ( an integer ) from the user

a) Write a method called GetDayOfMonth() which prompts and accepts the day of the
month (an integer) from the user then returns this number. Use exception handling to
indicate that an exception occurred if the day of the month is less than one or greater
than thirty-one, but do not handle the exception in this method.
b) Write a method called ProcessDay() that calls the GetDayOfMonth() method and
displays the day returned by the method. Handle any exceptions that may occur in the
ProcessDay() or passed up to it
from methods called. Rethrow any exception that occurs.
c) Write a main() method which calls the ProcessDay method. Handle all exceptions
that may occur.
d) Ensure that you program compiles and runs correctly, both when there is good input
(0< day <32) or invalid input (day <1 or day >31).

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!