Implement a public class date that represents a date

Assignment Help JAVA Programming
Reference no: EM131274205

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".

Reference no: EM131274205

Questions Cloud

Identify and describe the topic of consideration : Identify and describe the topic of consideration. ((Bill of rights)) In ACA
American accounting association decision-making model : Work through this scenario using the American Accounting Association decision-making model, and decide what action Luke should take.
What is the difference between composition and aggregation : What is the difference between composition and aggregation? Draw class diagram based on the code below. What is composition and what symbol is used to represent it?
Evaluate whether you had any issues with accuracy : In this section, you will summarize each article by highlighting the purpose, research questions and hypotheses, methods, results, and conclusions drawn regarding the topic the article represents. Then, evaluate the merits of the article, includin..
Implement a public class date that represents a date : 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.
What strategies behind implementing cloud computing programs : What are some of the major strategies and risks behind implementing cloud computing programs in today's technology filled world?
Marketing study about infinity model qx80 : Topic: Marketing study about Infinity model QX80, Increase Infiniti QX80 market share in UAE for big luxury SUV cars market by implementing market strategy for QX80 with main competitors.Number of pages: 12-15 pages
Summarized the discussion about the validity and reliability : Summarized the discussion about the validity and reliability of the instruments, tools, or surveys.
What suggestions do you have to address these concerns : Because many assessments and inventories are now available and completed online, counselors need to be aware of the issues related to the use of technology in career counseling. What are some of the concerns that you should be aware of when using ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Constructs a lock with a given combination.

A combination lock has a dial with 26 positions labeled A..Z. The dial needs to be set three times. If it is set to the correct combination, the lock can be opened.

  Design an abstract data type in java

Design an abstract data type in Java that represents a musical pitch

  Calculate percentage of increase in price - java application

Write a Java application that will take an input using an input dialog box for the item price and assign it to a variable

  Java program for presidential elections

Write a java program for Presidential Elections, the user will enter his votes based on the code for each candidate. The program will add the total votes for each candidate and proclaim the winner whoever got the most number of votes.

  Write a java program to accept a day number

Write a Java program to accept a day number from the user and display the corresponding day name by using the if/else construct. Rewrite the program using the switch case construct

  Simulate the transactions of a checking account

create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount.

  Write a program to that finds lowest n closing dow jones

You are to write a program to that finds lowest N closing Dow Jones Industrial averages and their dates in order by closing average. The program should prompt for the number of lowest closing averages requested by the user to be output.

  Highest precedence in java programming

Which operator is considered to be with highest precedence in java programming?

  Example of a problematic programming situation or scenario

Suggest one (1) example of a problematic programming situation or scenario that the use or implementation of a sequence structure could resolve

  Create java application to create and maintain contact list

Create a JAVA application to create and maintain a contact list - Create a database to store the contact information.

  Write a program that prompts the user to enter a point

Write a program that prompts the user to enter a point (x,y) and checks whether the point is within the rectangle centered at (0,0) with width 10 and height 5

  Handling the unexpected in life

100-300 Words. We often are handling the unexpected in life.  Kids and pets can offer many of these unexpected occurrences. Where do you see life's every day exception and how would the programming look for those?  Humor is appreciated.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd