Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a list class named 'List'. Implement this class using a dynamic array. The initial size of the dynamic array is to be 2 .

Create a list class named 'List'. Implement this class using a dynamic array. The initial size of the dynamic array is to be 2. If the array is ever full when an insert operation is called, you are to add 2 to the size of the array.
Write a small main program to test your List class with the following menu:
Insert (value to be inserted is entered from keyboard)
Remove (value to be removed entered from keyboard, remove first occurrence if one exists and shift other items to the left so as to not leave a blank slot)
Print List (all values, one per line)
Quit
After you have everything working, derive a class named Set from List. A Set is like a List but does not allow duplicate values to be stored. Change the main program so that you ask the user at the beginning of the program if they want to use a List or a Set. Proceed with the mainfprogram as I outlined before with whichever type they choose.
Keep in mind the following:
Name your source files set.h, set.cpp, and main.cpp.
With invalid data, your program should respond appropriately.
Each function prototype should have a description, preconditions, and postconditions.
Test your code when you think you are finished. Try to break it. After you are done trying to break it, I will then try.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago