do in java Date class Design, implement and test a Date class to represent the date of a transaction, i.e., the date on

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

do in java Date class Design, implement and test a Date class to represent the date of a transaction, i.e., the date on

Post by answerhappygod »

do in java
Date class
Design, implement and test a Date class to represent the date of a
transaction, i.e., the date on which the student wishes for the DJ
to play. A Date has a day, a month and a year, all stored as
integers. By default, the date is set to the current date, which
can be obtained from the system using the Calendar class. The Date
class may store the current date as valid attribute values.The year
of a Date must never be less than 2021, the month must have values
equal to, or between 1 and 12. The day must be between 1 and
whatever is the maximum number of days in that month.
If the month is February, the maximum number of days will depend on
whether the year is a leap year. A year is a leap year if it is
divisible by 4, unless it is divisible by 100. However, it is a
leap year if it is divisible by 400. For example:
1996, 2000 and 2004 are all leap years.
1999, 2001 and 2100 are not leap years.
A Date can return the values of its attributes, and change them. It
displays itself in the form:
10 February 2021
A Date object can receive input values from the keyboard to store
these in each of its attributes if they are valid. These values
must be validated before they initialise the instance variables of
the class
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply