Write a program that creates a vector of strings

Assignment Help C/C++ Programming
Reference no: EM132107275

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.

Reference no: EM132107275

Questions Cloud

Displays a count down to zero from a number supplied : Displays a count down to zero from a number supplied by the user at the command line.
Discuss the complications of liver disease : Patient presents with malnutrition secondary to liver disease. Name two (2) nutrition or medical problems and discuss the complications of liver disease
Write a function called reverselist that creates a new list : Write a function called reverseList that creates a new linked list containing student_t nodes of an input linked list in the reverse order without destroying.
Prompt the user for a price in the form xx middot xx : If the price entered is negative, print an error message and start over requesting either a new-price or to quit (indicated by entering a 'q').
Write a program that creates a vector of strings : 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.
Write a program that prompts for and reads in two names : Write a program Names.java that does the followingm prompts for and reads in two names from the user.
Create a prototype for an application : A small hospital has contacted you and asked you to create a prototype for an application that can handle all of their administrative activities.
Simulate arcade car racing game : If you get to the end of the screen, the car should start over on the left side of the screen. The AI car should start over but should move faster this time.
What would be a good diet for patient : What would be a good diet for this patient? Breakfast lunch and dinner?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd