subject

Write a class called Date that represents a date consisting of a day, month, and year. A date object should have the following methods: public Date(int day, int month, int year) -- Constructs a new Date object to represent the given date public int getDay() -- returns the day value of this date public int getMonth() -- returns the month value of this date public int getYear() -- returns the year value of this date public void addDays(int days) -- Moves the Date object forward in time by the given number of days public int daysTo(Date other) -- Returns the number of days between this Date and the other Date public boolean isLeapYear() -- Returns true if the year of this Date is a leap year. A leap year occurs when the value of the year is divisible by 4, except when it is divisible by 100 and not 400 (so 1700, 1800, and 1900 are not leap years) public String toString() -- returns a String representation of this date in the form day/month/year Write a program in which to test your class. This program should prompt the user to enter the days, months, and years of two separate dates, and then print out the number of days between these two dates.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
question
Computers and Technology, 25.06.2019 02:00
What type of multimedia is a game cd? game cds are examples of multimedia
Answers: 1
question
Computers and Technology, 25.06.2019 04:40
1. instructions: in your response, make an argument for whether for whether it is better for waketown to build its new wake heights subdivision or to preserve the wake wetlan to preserve the wake wetland preserve. use evidence from at least two of the sources below to support your claim. be sure to introduce your precise claim, develop the claim with evidence from the sources, and demonstrate relationships between ideas. (15 points)
Answers: 2
You know the right answer?
Write a class called Date that represents a date consisting of a day, month, and year. A date object...
Questions
Questions on the website: 13722360