Write the constructor date which has 3 parameters

Assignment Help JAVA Programming
Reference no: EM13772077

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. Date has a constructor with 3 parameters and 4 methods. Write the constructor Date which has 3 parameters: int d, int m, int y; and the 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 developed in the book in chapter2 in pages 99-100 in the code-listing 2-32 (NamesDialog.java) for input and output.

Remember that you will prompt the user to enter:

1. a month;

2. a day;

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 :

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

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

3. Otherwise y1 is not a leap year.

Reference no: EM13772077

Questions Cloud

Write an application that simulates a not-so-busy airport : Write an application that simulates a not-so-busy airport, where different kinds of aircrafts, such as helicopters (military and civilian) ,airplanes ( passenger and military), can take off and land.
Safety first at the samson company : The Samson Company is in the middle of a contest to boost production. Joe Miller's and Al Scott's departments have been running nip and tuck, with Joe's team currently in the lead.
How many grams of sodium bicarbonate did : Calculate the moles of gas produced in 2 L volume container, 743 torr and 50 ºC if the gas behaves as ideal - how many grams of sodium bicarbonate did one begin with?
If income elasticity of demand is : If income elasticity of demand is 2.12, it means that quantity demanded will __________ by 2.12 percent for every __________ percent __________ in income.
Write the constructor date which has 3 parameters : 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. Date has a constructor with 3 parameters and 4 methods. Write the constructor Date which has..
How the authors used chemical engineering design : Summarize the research problem and how the authors used chemical engineering design principles to study it. Summarize the methods and the key findings and conclusions.
Main challenges of managing a fresh water resource : An introduction that identifies the main challenges of managing a fresh water resource in your home town or city. State the activities that have impacted this local fresh water supply. Include the name of the lake or river, the specific pollution s..
What is diversity : What is diversity? What does it mean to you? To society? What is the relationship between compliance with legislative acts and valuing diversity? Explain.
Write a research paper for kim woods : Write a research paper for KIM WOODS.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Update your website to include a simple web form

Update your website to include a simple web form as discussed in your design document. Use JavaScript to validate the form contents and display the results of that validation to the user in a popup window

  2 before we developed a stringlog adt it represents a log

2. before we developed a stringlog adt. it represents a log that holds objects of class string. suppose that instead of

  The sixth amendment allows the due process right to council

The Sixth Amendment allows the due process right to council. Several Supreme Court cases have clarified this right for those who cannot afford their own attorneys. Discuss the right to an attorney for indigent defendants. What are the three main syst..

  Write a java program that draws a square abcd

Write a java program that draws a square ABCD. The points A and B are arbitrarily specified by the user by clicking the mouse button. The orientation of the points should be counter-clockwise

  Write a program to display the customer''s name

Write a program that prompts the salesperson for the name of the customer and the price of the textbooks sold to that customer.• The program should display the customer's name and the total compensation

  Develop game using the concepts of cohesion

Develop any game of your choice using the concepts of Cohesion, Coupling and RDD, i.e., responsibility-driven design.

  How to access to elements of document object model

To limit creation of malicious code, do you believe that access to elements of document object model and some Javascript functionality be limited?

  Implement bounded partial queue by using signaling mechanism

Implement the same using a signaling mechanism that signals to all waiting dequeuers and do a performance comparison using timing analysis. Which works faster?

  Class to initialize values

Create a constructor that allows a user of the class to initialize values. Also create a method named SetJustSold()(Hint ++) that increments the number of hot dogs the stand has sold by one and should also increase the TotalSold by one

  Create a website

The preplanning design consists of a document that defines the element specifically requested by the client and indicates where these features will be located on the Website

  Picky publishing house publishes stories

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..

  Write a recursive public method

Write a recursive public method in our BST class that returns a reference to the information in the node containing the smallest value in the tree. The signature of the method is

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