this is my code and the question need to be continued.
#include using namespace std;class Course{private: string name; string *studentList; int size, capacity=10;public: Course(){ name = "TBD"; size = 0; studentList = new string[capacity]; }Course(string s){ name = s; size = 0; studentList = new string[capacity]; }void setName(string s){ name = s; }getter/accessor for variable name string getName(){ return name; }};int main(){ Course a, b("Yankee"); cout < a.getname()=""><> a.setName("Mets"); cout < a.getname()=""><> cout < b.getname()=""><> return 0;}this is the Question:: Continue with Team class:a) Copy the previous program to a new file.b) Implement the addMember, removeMember and display member functions toTeam class.addMember(string) - add a new student with given name to the members.removeMember() - delete the last added member from the members, nodeletion if there is no member in the members.display() - display Team information.Use following main() to test your class.int main() {Team a("Mets");a.removeMember(); //a.display();a.addMember("David");a.addMember("Steven");a.addMember("Sara");a.addMember("Tom");a.display();a.removeMember();a.display();a.removeMember();a.display();return 0;}Output from given main function:No member to removeTeam name:MetsMember List:Team name:MetsMember List: David Steven Sara TomTeam name:MetsMember List: David Steven SaraTeam name:MetsMember List: David Steven
class Course{private: string name; string *studentList; int size, capacity=10;public: Course(){ name = "TBD"; size = 0; studentList = new string[capacity]; }Course(string s){ name = s; size = 0; studentList = new string[capacity]; }void setName(string s){ name = s; }getter/accessor for variable name string getName(){ return name; }};
int main(){ Course a, b("Yankee"); cout < a.getname()=""><> a.setName("Mets"); cout < a.getname()=""><> cout < b.getname()=""><> return 0;}
this is the Question:: Continue with Team class:a) Copy the previous program to a new file.b) Implement the addMember, removeMember and display member functions toTeam class.addMember(string) - add a new student with given name to the members.removeMember() - delete the last added member from the members, nodeletion if there is no member in the members.display() - display Team information.Use following main() to test your class.int main() {Team a("Mets");a.removeMember(); //a.display();a.addMember("David");a.addMember("Steven");a.addMember("Sara");a.addMember("Tom");a.display();a.removeMember();a.display();a.removeMember();a.display();return 0;}Output from given main function:No member to removeTeam name:MetsMember List:Team name:MetsMember List: David Steven Sara TomTeam name:MetsMember List: David Steven SaraTeam name:MetsMember List: David Steven
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here