/* Quizshow Class Implementation */ #include #include "Quizshow.h" using namespace std; /* Quizshow member function setShowtitle: * Input: * showtitle - object's show title * Process: * sets the value of member variable showTitle * Output: * none */ void Quizshow::setShowtitle(string showtitle) { showTitle = showtitle; return; } /* Quizshow member function setHost(): * Input: * hostname - host’s Name * Process: * sets the member variable host = hostname * Output: * none */ void Quizshow::setHost(Name hostname) { host = hostname; return; } /* Quizshow member function addContestant: * Input: * q_contestant - Contestant object to be added * Process: * sets the member variable contestant[numContestants] = q_contestant * Output: * object contestant[numContestants] data members are set * increments numContestants */ void Quizshow::addContestant(Contestant q_contestant) { contestant[numContestants] = q_contestant; numContestants++; } /* Quizshow member function getShowtitle: * Input: * none * Process: * retrieves the value of member variable showTitle * Output: * returns the object's showTitle */ string Quizshow::getShowtitle() const { return (showTitle); } /* Quizshow member function getHost(): * Input: * none * Process: * retrieves host's Name * Output: * returns the object's host Name */ Name Quizshow::getHost() const { return (host); } /* Quizshow member function getContestant(): * Input: * index - index of contestant to be retrieved * Process: * retrieves data member contestant[index] * Output: * returns data member contestant[index] */ Contestant Quizshow::getContestant(int index) const { return (contestant[index]); } /* Quizshow member function getNumcontestants(): * Input: * none * Process: * retrieves data member numContestants * Output: * returns value of data member numContestants */ int Quizshow::getNumcontestants() const { return (numContestants); }