Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

More Books

Students also viewed these Databases questions

Question

Refer to Exercise

Answered: 1 week ago

Question

=+3. What resources will these tactics require?

Answered: 1 week ago