[Logo]
Forums Register Login
Organiser for Apointments
Hi,

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.

Thanks.




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.
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature


This thread has been viewed 481 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 22, 2018 16:27:04.