data structure
The data structure may have the following services encapsulated in an interface: interface IAppointmentSchedule{ void addTime(int hour, int minute); void removeTime(int hour, int minute); void addAppointment(String name, int hour, intminute); //you may or may not need more methods…. } For easy management of appointments, it’s probably convenient to have an appointment class like: Class Appointment { String day; //like Monday, Thuesday, …. String patient; int hour, minute; //methods you need } With this Appointment class, a data structure class that implements the above interface might look like: class AppointmentSchedule implements IAppointmentSchedule{ private List schedules; //…. } However, this is just one of the ways how data are organized. For instance, you can also write an Appointment class without String instance variable "day", and use a hash map like: Map schedules = new HashMap(); The "key" of the map can be a weekday like "Tuesday" or "Thursday", but "key" can also be a date like 1/30/2016". To control the program flow of actions, a controller may also be needed, which is much like the one we had in that example of AddressBookApp. interface AppointmentOps{ Void initialize(); Void runMainFlow(); Void addData(); //you would need to add data manually if you do not use a data text file. //…. } Do you need elements like "Doctor" or "Patient"? Think about that use case (in the assignment sheet), when you run the program, you play a role as doctor or patient. "Who is the doctor?" is irrelevant, and for making an appointment, only patient names are needed (as shown in the use case). So, such elements would not play roles in software operation. Again, the example can also be helpful here…. We have not talked about yet how we may express a design using diagrams or other means, so for this first assignment, you are not required to do any diagramming. All you need to do is to use the example to come up with a program structure in your mind, and implement it in code.
WE ALL KNOW CLASSWORK IS BORING. THUS, OUR ESSAY HELP SERVICE EXISTS TO HELP STUDENTS WHO ARE OVERWHELMED WITH STUDIES. ORDER NOW FOR 20% DISCOUNT. USE CODE SAVE20
Source link
data structure was first posted on April 1, 2020 at 11:41 am.
©2020 "My Assignment Geek". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at savvyessaywriters@gmail.com