For C++ The first TODO is to gather the necessary input from the user to complete the story. Create the variables that you will need; be mindful of which data types to use! Remember that string input should use getline instead of just cin by itself. The second TODO is to display the story once again, but now with the values entered by the user. This is where you will use the variables you made previously. The third TODO is to seed the random number generator using the current system time. We will need this in order for the next section to work. The fourth TODO is to create a visual graph of the stock price fluctuating. You will need to use the setfill and setw stream manipulators to make this work. The stock price value determines how many of the symbols to display. Make sure to round the price to the nearest dollar so that the chart is as accurate as possible. There are five fluctuations that you need to model in your program: The stock price is multiplied by a random number between 2 and 4 (inclusive) The stock price is divided by a random number between 2 and 4 (inclusive) The stock price is added by a random number between 2 and 4 (inclusive) The stock price is subtracted by a random number between 2 and 4 (inclusive) The stock price is multiplied by a random number between 2 and 4 (inclusive) You need to use the random formula to generate the random numbers needed above. After each fluctuation, display the updated stock graph. The final TODO is to print out the final stock price after all the fluctuations. Since we are talking about money, make sure that the output is properly formatted (only contains two decimal values).
For C++
The first TODO is to gather the necessary input from the user to complete the story. Create the variables that you will need; be mindful of which data types to use! Remember that string input should use getline instead of just cin by itself.
The second TODO is to display the story once again, but now with the values entered by the user. This is where you will use the variables you made previously.
The third TODO is to seed the random number generator using the current system time. We will need this in order for the next section to work.
The fourth TODO is to create a visual graph of the stock price fluctuating. You will need to use the setfill and setw stream manipulators to make this work. The stock price value determines how many of the symbols to display. Make sure to round the price to the nearest dollar so that the chart is as accurate as possible. There are five fluctuations that you need to model in your program:
- The stock price is multiplied by a random number between 2 and 4 (inclusive)
- The stock price is divided by a random number between 2 and 4 (inclusive)
- The stock price is added by a random number between 2 and 4 (inclusive)
- The stock price is subtracted by a random number between 2 and 4 (inclusive)
- The stock price is multiplied by a random number between 2 and 4 (inclusive)
You need to use the random formula to generate the random numbers needed above. After each fluctuation, display the updated stock graph.
The final TODO is to print out the final stock price after all the fluctuations. Since we are talking about money, make sure that the output is properly formatted (only contains two decimal values).
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images