I am currently working on a C++ project and i need some help these are the instructions...
The goal is to build some "event object" classes that would be useful when scheduling events. In this assignment, your task is to design, implement and test classes to store information about Events and Schedules.
design
Normally object oriented design begins with an analysis of the data and operations that belong together. In this case, you have been given a list of operations, so you only need to worry about how to store and manipulate the data. You also need to decide what parameters and return values the operations below require.
NO event can have a duration of more than 24 hours.
Error checking must be implemented but you do not have to handle inputs that are the wrong data type.
Note: The file for this assignment are a template of what you will need. You will have to add the appropriate libaries and header files when needed so as to compile your code.
Part A (50 points)
For Part A, students are asked to implement the Event class. An event made up of the event name, start and finish dates and start and finish times. Using the dates and times, you should be able to calculate the duration of an event. Also, you will need to consider how to store the date and the time. You may want to consider the Date class and Time class that were covered during class.
This class should contain the following methods:
Event:
•Constructor(s) (default, non-default, and copy)
•Destructor
•GetStartDate: Return start date
•GetFinishDate: Return finish date
•GetStartTime: Return start time
•GetFinishTime: Return finish time
•GetDuration: Returns the duration of the event in days, hours, minutes and seconds.
•SetEventName: Change the name of the event
•SetStartDate: Change the start date of the event
•SetFinishDate: Change the finish date of the event
•SetStartTime: Change the start time of the event
•SetFinishTime: Change the finish time of the event
•Print(): Print the details of the event (event name, start date, start time, finish date, finish time, duration)
You seem to be on the right track. We werent in class with you so we dont know to much on those date and time classes. Try writing the program yourself and we can always edit it and help you out.
Im pretty sure i have the event.h and the main.cpp correct but im starting to get a little lost on my event.cpp. Suggestions??
HEADER!
#ifndef EVENT_H
#define EVENT_H
// Event class declaration.
#include <string>
using namespace std;
class Event
{
public:
Event(); //Default Constructor
Event(string name, int sday, int smonth, int syear, int fday, int fmonth, int fyear,
int shours, int smins, int fhours, int fmins); //Constructor
Event(Event & Event); //Copy Constructor
~Event(); //Destructor
void Print() const;
Date GetStartDate() const;
Date GetFinishDate() const;
Time GetStartTime() const;
Time GetStartTime() const;
float GetDuration() const;
void SetEventName(const string name);
void SetStartDate(const int day, const int month, const int year);
void SetFinishDate(const int day, const int month, const int year);
void SetStartTime(const int hours, const int mins);
void SetFinishTime(const int hours, const int mins);
private:
string name;
Date startDate;
Date finishDate;
Time startTime;
Time finishTime;
};
#endif /* EVENT_H */
EVENT.CPP
#include <iostream>
#include "Event.h"
using namespace std;