c++ calendaring system
Define and implement a collection of classes that model an event hierarchy for a calendaring system. Your design will include the base class Event and two subclasses, Appointment and Meeting, as well as two support classes Date and Contact. You will need header and implementation files for each. The details of each class are below.
The descriptions provide the basics of the class. You need to apply good design principles that have been demonstrated through the examples in the book and in class. You will need to apply inheritance to make a good hierarchy as well as proper visibility modifiers, naming conventions, how you provide access to the internal data, potentially useful overloading, etc.
Class: DateTime
This class represents a date for an appointment.
• date : A string representation of the date the event will occur.
• startTime : A string representing the start time of the event.
• stopTime : A string representing the start time of the event.
The class should ensure that the date, startTime, and endTime have appropriate default values.
There should be operations to set and get the various pieces of information.
For the record, from a design point of view this is a pretty weak class. However, it helps reenforce the notion that a system consists of a collection of interacting classes. We need a few more techniques before we can create a really solid class.
Class: Event
This class represents a general entry. It maintains two pieces of data:
• id : A string storing the id. Event ids are intended to be unique.
• date : A date instance.
• title : A string storing the name of the event.
External users (outside the class and any of its subclasses) must not be able to create instances of this class.
There should be operations to set and get the various pieces of information. There should be an operation
string toString();
that returns a string representation of the Meeting.
Class: Calendar
This class represents a collection of Events. It maintains two pieces of data:
• events : An array (not a template-based container) of Event pointers with unbounded capacity
• eventCount : A counter indicating the number of events in the collection
The class should support the following operations
// This operation returns true if the event is successfully added to the collection. False will
// be returned if there is already an event in the collection with the same id.
//
bool addEvent(Event *event);
// This operation removes the event with the given id from the collection. If there is no
// event with the specified id, this operation takes no action.
//
void remove(string id);
// This operation returns an array of events whose title contain the specified keyword.
// The parameter eventCount is updated with the number of events in the list.
//
Event** findEventsByKeyword(string keyword, int &eventCount);
Class: Contact
This class represents an individual that can be associated to certain types of events.
• name : A string storing the name of the contact.
• phone : A string storing the phone number of the event.
External users (outside the class and any of its subclasses) are able to create instances of this class.
There should be operations to set and get the various pieces of information. There should be an operation
string toString();
that returns a string representation of the Contact.
Class: Meeting
This class represents a meeting that, in addition to the title and date, has a location. It maintains for things:
• date : A string representing the date and time of the appointment.
• title : A string storing the name of the event.
• location : A string storing the name of the event.
• roster : An array (not a template-based collection) of contacts attending the meeting.
External users (outside the class and any of its subclasses) are able to create instances of this class.
There should be operations to set, get, and work with the various pieces of information. (Keep in mind that roster is going to be a collection. This means you will need to provide access to other information.)
Class: Appointment
This class represents an appointment with an individual person. It maintains three different pieces of information:
• date : A string representing the date and time of the appointment.
• title : A string storing the name of the event.
• person : The contact information for the person attending the meeting.
External users (outside the class and any of its subclasses) are able to create instances of this class.
There should be operations to set and get the various pieces of information. There should be an operation
string toString();
that returns a string representation of the Appointment.
源码传送门
传送门:https://pan.baidu.com/s/1JJs9vbZahUCB6cQvXLgAVg?pwd=1111
标签:string,collection,system,c++,class,calendaring,date,should,event From: https://www.cnblogs.com/codewriter/p/16773259.html