Forums Register Login
Organiser for Apointments

I'm trying to write an organizer that adds dates and times for appointments stored in an array. Currently I have completed the Appointment, Date and Time classes but I'm having trouble with the Organizer class (below). Not sure how to add the dates into the array as each element should be a new instance of the date. Little confused with what I should be adding into the countByDate and addAppointment methods.

I included the Appointment class below too, if that helps.


I am not convinced about your addAppointment method. I think its signature should be addAppointment(Date d, Appointment a). (Or addAppointment(Appointment a).)
You should use the Appointment class to create appointments, not a different class.
I think you need to step back and consider the design of your organiser. How do you intend to store appointments? How many? Are you linking them to dates? Are you using an array because it is the best data structure, or because you know about arrays?
When you have got all that worked out, then you can consider writing some code.
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java

This thread has been viewed 544 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 22, 2019 19:20:18.