My program runs as follows first displays the local start time, which would be the current time and would work as almost like the starting point of stopwatch. We than have a vector which is where all the input files information is stored. After, the vector is created we have to fill the vector with the information from the input files. Then we read all the data from the vector and output into 2 files. Lastly the end time is display with the elapsed time.
I created a Stock class which contains the private member variables and the public constructors, destructors and accessor functions, that will be used. After my Stock class is created the function definition are displayed. In the function definitions, the definitions are used to retrieve the date from the vector after the vector is created. …show more content…
In the void function named fill vector will store the data from the input files. There’re seven strings which are used to hold the input files lines. I used ifstream to input all the files from the input directory. Then there is a while loop that would check if the opened file is good, then its used to retrieve each line and word. After I only store ticker name, date, open price, close price and push them back to the vector for each input file and after I closed and cleared each file. All 25 files date retrieve using this void function. Now we have the print vector function, which will output all of the information from the vector. In this function there is two ofstreams one that is Open prices and the other that is Close prices, in the streams are directories where the files will be outputted. Next there is a for loop that will allow to display by the vector’s size. Now we us the streams open price and close price to output the date, ticker name, open price and close price into their corresponding