The datejava class implement a public class date that


Assignment

This assignment will use the following description to implement a Dialog class for the Leap Year Problem. You need to decompose this problem into 2 classes:

1.The Date.java class. Implement a public class Date that represents a date composed of a month , day, and a year. Declare month, day, and year as integers. Write 4 methods:

"daysIs()" which returns a day

"monthIs()" which returns a month

"yearIs()" which returns a year

"isLeapYear()" is needed in the class Date. It has one parameter year and returns a boolean. Write the method isLeapYear() knowing that a year is defined to be a leapyear it is a multiple of 4, and if it is is a multiple of 100, it must also be a multiple of 400. isLeapYear() thus decides when a year is a leap year. (see the discussion on "Hints for Assign5" to discover specific examples of a LeapYear).

2.The DateJDialog.java class: which implements the GUI. Please use the Dialog boxes needs to use dialog boxes such as JOptionPane.showInputDialog("Please Enter a day ");

Remember that you will prompt the user to enter:

1.a day;

2.a month;

3.a year

And out of these 3 you will be able to create a Date. Then you will use the dialog box to tell the user whether the year entered was a leapyear or not a leapyear.

The purpose of the Date.java that you will implement is to decide whether a year is a leap year. Here is a definition of when a year is considered a leap year :

year y1 is a leap year if it is multiple of 4.

year y1 is a leap year if it is a multiple of 100, it must be a multiple of 400.

Otherwise y1 is not a leap year.

Do not forget to compile the 2 java files. To verify that the DateJDialog.java works, in TextPad after you compile DateJDialog.java, Click on Tools, Click on "Run Java Application".

Solution Preview :

Prepared by a verified Expert
JAVA Programming: The datejava class implement a public class date that
Reference No:- TGS01676979

Now Priced at $40 (50% Discount)

Recommended (97%)

Rated (4.9/5)