Write a program that creates a vector of strings called v


Program must be written in C++:

Write a program that creates a vector of strings called V. Vector V grows and shrinks as the user processes the transactions from a data file called data.txt.

The transaction file can only include three commands: Insert, Delete and Print. With Insert command, you get two more information, the information you need to insert and the position it should be inserted. With Delete, you get one more information that indicates which element (index) should be deleted. Print command means the content of the vector should be printed on the screen.

For example, you may have the following information in your file: Insert Hello 4 Delete 5 Print

The first line indicates that The word ?Hello? should be inserted in V[4]. Of course you should check if this insert is possible.

This insert is possible if the position you are attempting to insert the element is not beyond the size of the vector.

The second line means V[5] should be removed.

Again this operation should only be allowed if the index is not beyond the current size of the vector. Test your program with the following transaction file:

Insert Total 0 Insert Normal 0 Insert Perfect 1 Insert Program 1 Insert Book 2 Print Insert Perfect 5 Delete 1 Delete 7 Insert Money 2 Delete 3 Print Note: Each command must be implemented in a separate function.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that creates a vector of strings called v
Reference No:- TGS02900730

Expected delivery within 24 Hours