Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that prompts the user to input three positive integers: * the year, * the month, and * the calendar day and

Write a Java program that prompts the user to input three positive integers:

* the year, * the month, and * the calendar day

and prints the date in written long format, if the date is valid, or an error message, otherwise.

Note: You may explicitly assume that every date introduced is after Thursday, 14 September 1752, which corresponds to the adoption of the Gregorian calendar by Great Britain and its colonies.

Example: Suppose the user enter the year 2017, 7 as month, and 3 calenday day, then your program should output Monday, July 3rd, 2017. However, if the user introduces 2017, 2, and 29, for year, month, and calendar day respectively, your program should signal an error, since 2017 is not a leap year.

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

More Books

Students also viewed these Databases questions