Question: Create a class called NumberList that holds a user-defined maximum number of integers in a vector. If more than the maximum number of integers is

Create a class called NumberList that holds a user-defined maximum number of integers in a vector. If more than the maximum number of integers is added an error message should be printed out. Write a method print_list that prints the numberof integers in the list and each number stored in the list. Create at least 2 NumberList objects, fill them, and print their contents. Include  NumberList class and print_list method below along with sample output. Use good C++ object-oriented design principles, including using a separate .cpp & .h file for defining NumberList.

Step by Step Solution

3.47 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

NumberListcpp c include NumberListh NumberListNumberListint maxNumber thismaxNumber maxNumber thiscount 0 void NumberListaddNumberint number if thisco... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!