Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me ASAP. This is in Java. Days Elapsed Since January 1 Application This programming assignment involves writing a Java application which inputs a

Please help me ASAP. This is in Java.

image text in transcribed

Days Elapsed Since January 1 Application This programming assignment involves writing a Java application which inputs a date from the user, and calculates how many days have elapsed from January 1 of that year to the date specified. The user enters the date from the console, as a string of characters in the format: MM DD YYYY. For example, if the user entens 03 01 2012 then th is represents March 1,2012. In this case, the number of days elapsed is 61: 1 for January, 29 for February (2012 is a "leap year"), and l during March itself Similarly, if the input were 01 01 2010 then the output should indicate that 1 day has elapsed. IMPORTANT: Do not use any standard calendar-related classes from the Java library for this project. The central idea of this assignment is to implement and use our own Date class. If we were to use a library class such as "Calendar", "GregorianCalendar", or "Date", that would be cheating. In addition to returning the correct result, your program must check for and deal with the following issues: 1. You may use standard Java library classes to check if the input is or is not valid Non-numeric data. numeric data. An appropriate error message for this case would be "Non-numeric data entered: mm dd yyyy Leap years. Not all years that are evenly divisible by four are leap years. Years that end in "00" (so called centurial years) are leap years only if they are also divisible by four hundred. Inappropriate month entered. Allowable values are 01 - 12. (There is no month 13, or month 0.) The error message might be: "Invalid month: Inappropriate day entered. The day value must be between 01 and the maximum for that particular month and year. For example: January and March always have 31 days; February has either 28 or 29, depending on the year. The error message might be: "Invalid day dd, for month-mm, year-yyyy". Inappropriate year: 2. 3. mm 4. 5. for our purposes, we will allow year values in the range of 1900- 2100 After one date string is processed, either successfully or with an error message, the program should ask the user to enter another date string. This "main loop" continues until the user enters the "g" command

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Use the gamma function with y = 2x to show that P(l/2) = .

Answered: 1 week ago

Question

=+Show the effects of a drought.

Answered: 1 week ago