• Post Reply Bookmark Topic Watch Topic
  • New Topic

Organiser for Apointments  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
Marshal
Posts: 56607
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!