CSIS 212 Programming Assignment 6 Instructions Exercise 7.13 JHTP (Date Class): Create a class called Date that includes 3 instance variables—a month (type int), a day (type int), and a year (type...

1 answer below »
Create a class called Date that includes 3 instance variables—a month (type int), a day (type int), and a year (type int). Provide a constructor that initializes the 3 instance variables and assumes the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day, and year separated by forward slashes(/). Write a test application named DateTest that demonstrates class Date’s capabilities.


CSIS 212 Programming Assignment 6 Instructions Exercise 7.13 JHTP (Date Class): Create a class called Date that includes 3 instance variables—a month (type int), a day (type int), and a year (type int). Provide a constructor that initializes the 3 instance variables and assumes the values provided are correct. Provide a set and a get method for each instance variable. Provide a method displayDate that displays the month, day, and year separated by forward slashes(/). Write a test application named DateTest that demonstrates class Date’s capabilities. This assignment is due by 11:59 p.m. (ET) on Monday.
Answered Same DayApr 24, 2021

Answer To: CSIS 212 Programming Assignment 6 Instructions Exercise 7.13 JHTP (Date Class): Create a class...

Valupadasu answered on Apr 25 2021
157 Votes
Date.java
Date.java
public class Date {
    private int month;
    private int day;
    private
 int year;
    Date(int month,int day,int year){
        this.month = month;
        this.day = day;
        this.year = year;
    }
    public int getMonth() {
        return month;
    }
    public void setMonth(int month) {
        this.month = month;
    }
    public int getDay() {
        return day;
    }
    public void setDay(int day) {
        this.day = day;
    }
    public int getYear() {
        return year;
    }
    public void setYear(int year) {
        this.year = year;
    }
    public void displayDate(){
        System.out.println("Date value :"+this.month+"/"+this.day+"/"+this.year);
    }
}
DateTest.java
DateTest.java
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.uti...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here