Please written by computer source JAVA. This is my third time reposting this question. I need DATETEST class written to fit my ALREADY WRITTEN date.java. thank you! Write DateTest class which includes the main method. The program should create three objects of the Date class and one of them should use the default constructor and the other two use three-parameter constructor. Print all three dates using toString method. Change the month, day, and year of one of the dates using set methods, and then use get methods to display the new value of month, day, and year. Print all three dates again using printDate method. (please include comments) Here is my "date.java" I just need you to help with the test class package class Date { // month, day, and year as private instance variables. private int month; private int day; private int year; //default constructor public Date() { // set the date to 1/1/2000 this.month = 1; this.day = 1; this.year = 2000; } // three-parameter constructor will include a given month, day, and year as parameters. public Date(int month, int day, int year) { this.month = month; this.day = day; this.year = year; } // get month public int getMonth() { return month; } // set month public void setMonth(int month) { this.month = month; } // get day public int getDay() { return day; } // set day public void setDay(int day) { this.day = day; } // get year public int getYear() { return year; } // set year public void setYear(int year) { this.year = year; } //toString method to return the date in “month/day/year” format as a string. @Override public String toString() { return month + "/" + day + "/" + year; } //printDate method to print the date in month/day/year format. public void printDate(){ System.out.println(month + "/" + day + "/" + year); } }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please written by computer source

JAVA. This is my third time reposting this question. I need DATETEST class written to fit my ALREADY WRITTEN date.java. thank you!

Write DateTest class which includes the main method. The program should create three objects of the Date class and one of them should use the default constructor and the other two use three-parameter constructor. Print all three dates using toString method. Change the month, day, and year of one of the dates using set methods, and then use get methods to display the new value of month, day, and year. Print all three dates again using printDate method. (please include comments)


Here is my "date.java" I just need you to help with the test class package

class Date {

// month, day, and year as private instance variables.

private int month;

private int day;

private int year;

//default constructor

public Date() {

// set the date to 1/1/2000

this.month = 1;

this.day = 1;

this.year = 2000;

}

// three-parameter constructor will include a given month, day, and year as parameters.

public Date(int month, int day, int year) {

this.month = month;

this.day = day;

this.year = year;

}

// get month

public int getMonth() {

return month;

}

// set month

public void setMonth(int month) {

this.month = month;

}

// get day

public int getDay() {

return day;

}

// set day

public void setDay(int day) {

this.day = day;

}

// get year

public int getYear() {

return year;

}

// set year

public void setYear(int year) {

this.year = year;

}

//toString method to return the date in “month/day/year” format as a string.

@Override

public String toString() {

return month + "/" + day + "/" + year;

}

//printDate method to print the date in month/day/year format.

public void printDate(){

System.out.println(month + "/" + day + "/" + year);

}

}

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education