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, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
question
Computers and Technology, 25.06.2019 02:30
What group of plants produce fruit? question 2 options: gymnosperms nonvascular plants seedless vascular plants angiosperms
Answers: 1
question
Computers and Technology, 25.06.2019 06:30
Which component is typically used as an amplifier a battery a transistor a microchip a diode
Answers: 1
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
question
History, 04.11.2019 14:31
question
Mathematics, 04.11.2019 14:31
question
Health, 04.11.2019 15:31
Questions on the website: 13722362