Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Coding Problems Thanks! Write a program that reads in the name of a company.Since the company name can contain spaces in the name you
C++ Coding Problems
Thanks!
Write a program that reads in the name of a company.Since the company name can contain spaces in the name you need to use getline to read the data into a string. Next you will read in the number of shares of stock, a stock purchase price, and a stock sale price. The number of shares will always be an integer value. With this data calculate the total amount required to purchase the stock. You also need to calculate the commission that has to be paid to the stockbroker. The stockbroker commission will be 2.5% of the amount required to purchase the stock. Note: the commission percentage should be put into a const double variable that you will use in your calculations. Output the name of the company, the cost of a share of stock, the total amount required to pay for the stock (not including the commission), the commission, and the total cost of the stock (including the commission) Next calculate the amount of income you will get when you sell the stock for the stock sales price. You also need to calculate the cost of the commission to the stockbroker for the sale of the stock. Again this will be 2.5% of the money you get for selling the stock. Output the price of one share of stock, the amount of money you get from the sale (before the commission is paid), the amount of the commission, and the amount of money you get from the sale after you have paid the commission to the stockbroker. All of the money amounts should be output in a fixed format with two digits to the right of the decimal point. Final calculate the difference between what you paid for the stock (including the commission), and what you received when you sold the stock (less the commission). This number will be negative if you have lost money. Here is some sample input data: Acme Software, Tnc. 1000 45.50 56.90Step 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