Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please do in C++, ----------------------------------- HOMEWORK #18-Stock Market Write a program to help a local stock trading company automate its systems. The company invests only
Please do in C++,
-----------------------------------
HOMEWORK #18-Stock Market Write a program to help a local stock trading company automate its systems. The company invests only in the stock market. At the end of each trading day, the company would like to generate and post the listing of its stocks so that investors can see how their holdings performed that day. Assume that the company invests in, say, up to 50 different stocks The input data is provided in a file called stockdata.txt in the following format: symbol openingPrice closingPrice todayHigh todayLow prevClose volume For example, the sample data may be MSMT 112.50 115.75 116.50 111.75 113.50 6723823 CBA 67.50 75.50 78.75 67.50 65.75 378233 The first line indicates that the stock symbol is MSMT, today's opening price was $112.50, the closing price was $115.75, today's high price was $116.50, today's low price was $111.75, yesterday's closing price was $113.50, and the number of shares currently being held is 6,723,82:3 The desired output is to produce two listings, one sorted alphabetically by stock symbol and another sorted by percent gain from the highest to lowest. The listing by stock symbol must be of the following form: *First Investor's Heaven**** Financial Report Stock Today Today Today Today Previous Percent Symbol Open Close High Low Close Gain Volume 120.50 ABC 123.45 130.95 132.00 125.00 AOLK 80.00 75.00 82.00 74.00 CSCO 100.00 102.00 105.00 98.00 IBD 68.00 71.00 72.00 67.00 MSET 120.00 140.00 145.00 140.00 8.67% 83.00-9.64% 099% 75.00-5.33% 115.00 21.74% 10,000 5,000 25, 000 15,000 30,920 101.00 Closing Assets: $9, 628,300.00 Likewise, the listing by percent gain must be of the following form HOMEWORK #18-Stock Market Write a program to help a local stock trading company automate its systems. The company invests only in the stock market. At the end of each trading day, the company would like to generate and post the listing of its stocks so that investors can see how their holdings performed that day. Assume that the company invests in, say, up to 50 different stocks The input data is provided in a file called stockdata.txt in the following format: symbol openingPrice closingPrice todayHigh todayLow prevClose volume For example, the sample data may be MSMT 112.50 115.75 116.50 111.75 113.50 6723823 CBA 67.50 75.50 78.75 67.50 65.75 378233 The first line indicates that the stock symbol is MSMT, today's opening price was $112.50, the closing price was $115.75, today's high price was $116.50, today's low price was $111.75, yesterday's closing price was $113.50, and the number of shares currently being held is 6,723,82:3 The desired output is to produce two listings, one sorted alphabetically by stock symbol and another sorted by percent gain from the highest to lowest. The listing by stock symbol must be of the following form: *First Investor's Heaven**** Financial Report Stock Today Today Today Today Previous Percent Symbol Open Close High Low Close Gain Volume 120.50 ABC 123.45 130.95 132.00 125.00 AOLK 80.00 75.00 82.00 74.00 CSCO 100.00 102.00 105.00 98.00 IBD 68.00 71.00 72.00 67.00 MSET 120.00 140.00 145.00 140.00 8.67% 83.00-9.64% 099% 75.00-5.33% 115.00 21.74% 10,000 5,000 25, 000 15,000 30,920 101.00 Closing Assets: $9, 628,300.00 Likewise, the listing by percent gain must be of the following formStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started