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.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • 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: 59092
180
  • 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.
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!