Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Below is the program I need help with. Not sure how to thisprogram. Please Help.

ID: 3613583 • Letter: B

Question

Below is the program I need help with. Not sure how to thisprogram. Please Help.

Create a class called Date that includes three instance variables:a month(int), a day(int), and a year(int). Provide a constructorthat initializes the three instance variables and assumes that thevalues provided are correct. Provide a set and a get method foreach instance variable. Provide a method displayDate that displaysthe month, day , and year separated by forward slashes (/). Write atest application name DateTest that demonstrates class Date'scapabilities.

Explanation / Answer

please rate - thanks TEST class dateTester { public static void main(String[] args) {Date a=new Date(1,11,2009); a.print(); a.setmonth(12); a.setday(1); a.setyear(2010); a.print(); System.out.println("month="+a.getmonth()+" day="+a.getday()+"year="+a.getyear()); } } CLASS class Date { private int month,day,year; public Date(int m, int d, int y) { month=m; day=d; year=y;} public void print() { System.out.println("The date is "+month+"/"+day+"/"+year); } public int getmonth() { return month; } public int getday() { return day; } public int getyear() { return year; } public void setmonth(int m) {month=m;} public void setday(int d) {day=d; } public void setyear(int y) {year=y; } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote