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.
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.
|