Write a cpp program that will declare a vector of integers

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

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.

Reference no: EM131324240

Questions Cloud

What is the probability that you can toss some number : What is the probability that you can toss some number, n, heads in a row? The idea here is to calculate the probability of trials that had all heads, such that a trial constitutes a set number of coin tosses.
What goal do the paris agreements set for temperature : What goal do the Paris agreements set for the global temperature? According to the sources in the article, how likely is it that we'll achieve this goal? Why
The price-quality and service compare at different stores : While evaluating alternatives, all of the following are appropriate questions you could ask before making a major purchase except. Is it possible to delay the purchase or to do without the item?  Should I pay for the item with cash or buy it on credi..
Explain how you would create a synthetic stock position : Explain how you would create a synthetic stock position and identify the cost. Suppose you observe a $100 stock price, identify any arbitrage opportunities.
Write a cpp program that will declare a vector of integers : CPSC P#9- 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:
Evaluate the august 165 puts and calls : Evaluate the August 165 puts and calls, and recommend a conversion or a reverse conversion. Determine the profit from the transaction if the options are held to expiration.
Find the initial speed of the van : A(n) 2655 kg van runs into the back of a(n) 848 kg compact car at rest. They move off together at 8.8 m/s. Assuming no friction with the ground, find the initial speed of the van
Determine the profit equations for the given strategies : Determine the profit equations for the following strategies, assuming that the options are held to expiration and exercised if in-the-money rather than sold back.
Declare the variables needed to solve the problem : A typical program flow would declare the variables needed to solve the problem, initialize the variables, solicit input, perform the data manipulation and/or calculations and display the result.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a c program that reads a as 100 decimal

Write a C program that reads A as 100 decimal (0x64) and calculate B so that A xor B = 120 (how do you show A B in C program?).

  Write a program that keeps track of important birthdays

Write a program that keeps track of important birthdays. You can implement it with a one-dimensional array with enumeration type indices, a two-dimensional array, or with parallel arrays.

  Logic in main and modularize

Classes (use hiding, getters and setters, multiple constructors and methods). Use functions - make your main very short. Try not to use any long detailed logic in main and modularize your application.

  Real time database for banking transactions

Design a real time database for banking transactions that would record actions of all transactions credited and debited. The algorithm should raise an alert to the bank manager in case any unauthorized debit is made. (model, algorithm and Cheddar ..

  Objective1 to give students practice in calling and writing

objective1. to give students practice in calling and writing their own functions.2. to give students practice in

  Question 1 write a program to print the following patterna

question 1 write a program to print the following patterna 1 b 11 2 2 21 2 3 3 3 31 2 3 4 4 4 4 41 2 3 4 5 5 5 5 5

  Prepare a temperature converter

Have to write a small program that prompts the user to enter a temperature in degrees Fahrenheit and then prints a massage as to whether the alarm will sound at that temperature.

  Write a c program that takes an integer argument

Write a C program that takes an integer argument from the command line and outputs the sum of all digits of the integer. For example, the result of the invocation sum of digits 12345 should be 15.

  Write a function named largest which will receive the array

Write a function named largest which will receive the array as input and return the variable LargestNumber.

  Create a coke machine program in c++

We will start by having the users insert their money. Since they can not physically insert the money, we will just ask them how much they wish to insert and we will keep track of how much money they have inserted.

  Takes a string containing a full name

Write a program that takes a string containing a full name and outputs each part of the name separately with its length. The name should be in the form of first, middle, and last name, separated from each other by a single space. For example, if the ..

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

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