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() << endl;         a.setName("Mets");         cout << a.getName() << endl;         cout << b.getName() << endl;         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 to Team class. addMember(string) - add a new student with given name to the members. removeMember() - delete the last added member from the members, no deletion 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 remove Team name:Mets Member List: Team name:Mets Member List: David Steven Sara Tom Team name:Mets Member List: David Steven Sara Team name:Mets Member List: David Steven

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

this is my code and the question need to be continued.

#include <iostream>
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() << endl;
        a.setName("Mets");
        cout << a.getName() << endl;
        cout << b.getName() << endl;
        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 to
Team class.
addMember(string) - add a new student with given name to the members.
removeMember() - delete the last added member from the members, no
deletion 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 remove
Team name:Mets
Member List:
Team name:Mets
Member List: David Steven Sara Tom
Team name:Mets
Member List: David Steven Sara
Team name:Mets
Member List: David Steven

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY