26 lines
863 B
C++
26 lines
863 B
C++
#include "Conference.h"
|
|
|
|
Conference::Conference(std::string title, unsigned int Sday, unsigned int Smonth, unsigned int Syear, unsigned int Eday, unsigned int Emonth, unsigned int Eyear) :
|
|
title(title), startDate(Sday, Smonth, Syear), endDate(Eday, Emonth, Eyear) {}
|
|
|
|
void Conference::addEvent(const Event &event) {
|
|
events.push_back(event);
|
|
}
|
|
|
|
std::string Conference::toString() {
|
|
std::string ret;
|
|
ret = title + " " + startDate.toString() + " " + endDate.toString() + "\n\n";
|
|
for (auto &event: events) ret += event.toString() + "\n";
|
|
return ret;
|
|
}
|
|
|
|
Event Conference::biggestAudience() {
|
|
Event maxAtendees = events[0];
|
|
for (auto &event: events) {
|
|
if (maxAtendees.getNumberOfAttendees() < event.getNumberOfAttendees()) {
|
|
maxAtendees = event;
|
|
}
|
|
}
|
|
return maxAtendees;
|
|
}
|