Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef ACTIVITY_H
- #define ACTIVITY_H
- #include "Event.h"
- #include <string>
- using namespace std;
- class Activity : Event
- {
- private:
- string m_location;
- public:
- Activity(string id, string month, string day, string year, string description, string location) : Event(id, month, day, year, description)
- {
- m_location = location;
- }
- string display()
- {
- if (m_location == "")
- return Event::display();
- else
- return Event::display() + " (" + m_location + ")";
- }
- bool contains(std::string s)
- {
- string data = m_description + " " + m_location;
- std::transform(data.begin(), data.end(), data.begin(), ::tolower);
- std::transform(s.begin(), s.end(), s.begin(), ::tolower);
- return (data.find(s) != std::string::npos);
- }
- string getID()
- {
- return m_id;
- }
- bool hasId(std::string id)
- {
- return (id == m_id);
- }
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement