Question: complete the following classes: Birthday.cpp #include Birthday.h #include Birthday::Birthday ( string de , string l , const Time &t , const Date &d ,

complete the following classes:
Birthday.cpp
#include "Birthday.h" #include Birthday::Birthday(string de, string l, const Time &t, const Date &d, string g):Event(de,l,t,d),gifts(g){ type = "birthday"; } string Birthday::getGifts() const{ return gifts; } string Birthday::getType() const { return type; }//Implement the printSummary() function
Concert.cpp
#include "Concert.h" #include Concert::Concert(string de, string l, const Time &t, const Date &d, int ti):Event(de,l,t,d),tickets(ti){ type = "concert"; } int Concert::getTickets() const{ return tickets; } string Concert::getType() const{ return type; }//Implement the printSummary function
Schedule.cpp
#include "Schedule.h" #include #include "Birthday.h" #include "Concert.h" using namespace std; Schedule::Schedule(int numEvents, Time t, Date d){ size = numEvents; numBd =0; numC =0; for (int i=0;i> hr >> m >> s >> d >> mt >> y; getline(cin, blank); if(type == "birthday"){ getline(cin, unique); events[i]= new Birthday(description,location,Time(hr,m,s),Date(d,mt,y),unique); numBd++; } else{ cin >> tickets; getline(cin, blank); events[i]= new Concert(description,location,Time(hr,m,s),Date(d,mt,y),tickets); numC++; }}} Time Schedule::getTime() const{ return time; } Date Schedule::getDate() const{ return date; } Date Schedule::getFirstEventDate() const{ int index =0; Event *firstEvent = nullptr; for(int i=0;igetDate(); else return Date(); }//Implement the getLastEventDate function Date Schedule::getLastEventDate() const{}//Implement the eventsPassed funciton int Schedule::eventsPassed() const{}//Implement the printSummary function void Schedule::printSummary() const{}
event.h
#ifndef EVENT #define EVENT #include #include "Time.h" #include "Date.h" using namespace std; // Add the virtual qualifier and change member functions to pure virtual functions when needed. class Event { protected: string description; string location; Time time; Date date; string type; public: Event(string de, string l, const Time &t, const Date &d); ~Event(){} string getDescription() const; void setDescription(string s); string getLocation() const; Time getTime() const; Date getDate() const; string getType() const; bool operator >(const Event & RHS) const; bool operator <(const Event & RHS) const; bool hasPassed(Date d, Time t) const ; void printSummary() const; }; #endif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!