This week's book giveaways are in the Scala and Android forums. We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line! See this thread and this one for details.
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.
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad: