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

here is the program that needs to be tested: public class MyDate { private int d

ID: 3639320 • Letter: H

Question

here is the program that needs to be tested:

public class MyDate
{
private int day;
private int month;
private int year;

public MyDate()
{
day = 1;
month = 1;
year = 2000;
}


public MyDate(int m, int d, int y)
{
day = m;
month = d;
year = y;
}

public int Getday() { return day; }
public int Getmonth() { return month; }
public int Getyear() { return year; }

public void Setday(int newday) { day = newday; }
public void Setmonth(int newmonth) { month = newmonth; }
public void Setyear(int newyear) { year = newyear; }

public void Write(PrintStream ps)
{
ps.printf("%d", "%d", "%d", day, month, year );
}

public void Read(Scanner s)
{System.out.print("enter month day year, separated by tabs: ");
month=s.nextInt();
day=s.nextInt();
year=s.nextInt();
}
}

Explanation / Answer

please rate - thanks

import java.io.*;
import java.util.*;
public class MyDate
{
private int day;
private int month;
private int year;

public MyDate()
{
day = 1;
month = 1;
year = 2000;
}


public MyDate(int m, int d, int y)
{
day = m;
month = d;
year = y;
}

public int Getday() { return day; }
public int Getmonth() { return month; }
public int Getyear() { return year; }

public void Setday(int newday) { day = newday; }
public void Setmonth(int newmonth) { month = newmonth; }
public void Setyear(int newyear) { year = newyear; }

public void Write(PrintStream ps)
{
ps.printf("%d", "%d", "%d", day, month, year );
}

public void Read(Scanner s)
{System.out.print("enter month day year, separated by tabs: ");
month=s.nextInt();
day=s.nextInt();
year=s.nextInt();
}
}