Cpsc p9- write a complete c program that will declare a


Assignment

This is the program:

This program will use 2 different data structures to perform the same tasks; a vector and a dynamically sized array

Write a complete C++ program that will: Declare a vector of integers with no specified size

Use a pointer to dynamically allocate an array of 10 integers Inside a loop:

Present the user with a menu with the following choices: Output all values to the screen

Add data values from a file

Add a new data value from the keyboard Remove a data value

Sort the data

Quit

Have the program perform the chosen menu option and then repeat the menu until the user chooses to quit.

Perform all operations (input, output, sort, add, remove) on both data structures.

Output: show 10 values per line with regular spacing

Add from keyboard:

Ask the user for an integer value.

Search the data structure (either one) for that value

If the value is NOT already in the data structures, then add it to both If the value is already in the data structures, do nothing

Add from file:

Ask the user for the name of the input file, and open that file Read all of the values from the file into both data structures Duplicate values should not be stored

Remove a value:

Ask the user for an integer value

If the value is found in the data structures, remove it from both If the value is not currently in the data structures, do nothing

Sort: sort the data in both data structures from small to large

All of the major array operations must be done in functions.

If vector operations take more than one or two lines, they should also be done in functions.

Name block and function comments are required as usual.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Cpsc p9- write a complete c program that will declare a
Reference No:- TGS01726891

Expected delivery within 24 Hours