Pointer and class Implement a class called Team as specified: data members: name - the name of the Team (defined as a dynamic variable) members - a dynamic array of string size - number of members in the team. functions: Course(): default constructor set name to “TBD”, and size to 0, members to empty list Course(string): one argument constructor set name, and size to 0, members to empty list accessor - an accessor for the name and size variable mutator - an mutator for the name variable Use following main() to test your class. int main() { Team a,b("Mets"); cout<

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 17PE
icon
Related questions
Question

Pointer and class
Implement a class called Team as specified:
data members:
name - the name of the Team (defined as a dynamic variable)
members - a dynamic array of string
size - number of members in the team.
functions:
Course(): default constructor set name to “TBD”, and size to 0, members to
empty list
Course(string): one argument constructor set name, and size to 0, members to
empty list
accessor - an accessor for the name and size variable
mutator - an mutator for the name variable
Use following main() to test your class.
int main() {
Team a,b("Mets");
cout<<a.getName()<<endl; // print TBD
a.setName("Yankee");
cout<<a.getName()<<endl; // print Yankee
cout<<b.getName()<<endl; // print Mets
cout<<a.getSize()<<endl; // print 0
return 0;
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning