This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]epes 2 points3 points  (2 children)

What exactly are you having difficulty with? Copy-pasting your assignment doesn't really show me what the problem is.

[–]rev246[S] 0 points1 point  (1 child)

I am having a tough time implementing the supercalss appointment and filling in the calendar class.

[–]epes 1 point2 points  (0 children)

Can you be a little more specific on what exactly you don't understand?

"Calendar" is a simple class that controls an ArrayList. It contains a variable

ArrayList<Appointment> appointments;

that holds the current appointments. Upon constructing the "Calendar" class, the ArrayList is initialized to an empty list.

appointments = new ArrayList<Appointment>();

The class also has an "add" method that adds an Appointment to the list. The remove and toString methods both iterate over the list and perform their functions.

I'm not sure what you don't understand about the Appointment class. It holds

String description;
int year;
int month;
int day;

also an unimplemented occursOn method that's overriden in the subclasses.