Answered step by step
Verified Expert Solution
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 If the array is ever full when an insert operation is called, you are to add 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started