This essay focuses on stock share price over the course. After the array of prices has been generated, the program will ask the user to enter the number of
For this exam question you are to write a complete program using Visual Studio to simulate the change in a company’s stock share price over the course of several days. The stock price on the first day will be $10, and each day the price will go up or down by a random amount between 0¢ and 50¢. The program will use an array of double to store the prices for each day. After the array of prices has been generated, the program will ask the user to enter the number of shares of the stock that they own. The program will then display a table showing the share prices and the value of the user’s shares for each day.
ask the user how many days they want to simulate, up to a maximum of 30, and then use a loop to populate an array of doubles with prices. The first element of the array will be 10. The program will use the C++ random number generator to produce a number between 0 and 100, then. It is subtract 50 and divide the result by 100 to obtain a number between -0.50 and +0.50. This number will be added to the element to produce the value of the next element; for example, if the first element is 10 and the random amount is -0.27, the second element should be 9.73. This should continue until prices have been produced for the desired number of days.
D. [4] Write a void function
The list should be generated using a for loop.
E. [5] Write the main program to seed the random number generator and call the functions to perform the task. It should declare the required variables as well: the number of days. It is array containing the share prices, the amount of shares and any other necessary variables. Provide the code as well as output from at least three test runs.
details;
Firstly, be sure
secondly, integrity
thirdly, be creative