plz help me with this class, calendar
Hi. I'm new to oop. I'm programming a calendar which has several classes. But i'm stuck in one the classes. i got so helpless with that. is the any one who can guide me how to write this class?
I've also attached the pdf file.
Speciﬁcation for the Calendar class:
• Event events – An array holding the scheduled events. Make it size 10 (small to support easy testing).
• int numEvents – The number of events currently scheduled.
• Calendar() – This constructor must initialize the ﬁelds of the new Calendar object: creating a 10-element Event and setting numEvents to 0 (zero).
• void addEvent(int year, int month, int day, int hour, String activity) – Create and add an Event instance to the associated Calendar.
• void addEvent(Event event) – Just add the Event object to the calendar.
• void removeEvent(int year, int month, int day, int hour, String activity)– Remove (all) Event objects in the associated Calendar where their attributes match all of the arguments in the call.
• void removeEvent(Event event) – Remove (all) Event objects in the Calendar that are equals to the event argument. Use the equals method from the Event class to compare the Events.
• void printEvents(int year, int month, int day) – Print every Event in the associated Calendar that matches the date arguments. Print each on a separate line, using the toString method from the Event class.
• void printEvents(Date date) – Same as above.
• Event findEvent(String activity) – Return the (ﬁrst) Event in the Calendar thathas a matching (equals) activity ﬁeld. If no match is found, you must return a reference type, so you return null.
• void dump() – Print every Event in the Calendar, as with printEvents.