Advertisement
4lphalfa

CSC 115 L3

Jan 26th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. public class CalendarDate
  2. {
  3.     private int year;
  4.     private int month;
  5.     private int day;
  6.    
  7.     public String toString()
  8.     {
  9.         String date = (this.year + "-" + this.month + "-" + this.day);
  10.        
  11.         return date;
  12.     }
  13.    
  14.     // Takes information, checks for valid, throws exception for invalid
  15.     public CalendarDate(int year, int month, int day)
  16.     {
  17.         if (day < 10)
  18.     }
  19.    
  20.     public CalendarDate() // creates 2000-01-01
  21.    
  22.     public void setMonth(int newMonth) {} // check if valid, throw exception, change month
  23.     public int getMonth() {}
  24.    
  25.     public String MDY_format() {}
  26.    
  27.     public void advanceDay() {}
  28.    
  29.     public boolean equals(CalendarDate other)
  30.     {
  31.         this.month == other.month;
  32.         this.month == other.getMonth();
  33.     }
  34.    
  35.     private static final = String[] monthLookup =
  36.     {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
  37.     monthLookup[month - 1];
  38.    
  39.     public static void main(String[] args)
  40.     {
  41.         CalendarDate day = new CalendarDate();
  42.         System.out.println (day.toString());
  43.         System.out.println (day);
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement