Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 3.5% of the amount required to purchase the stock.

Note: the commission percentage must be put into a const double variable that you will use in your calculations. The numeric variables in your program need to be of type double.

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 3.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:image text in transcribed

Acme Software, Inc. 1000 45.50 56.90 The output from the above input will be Company: Acme Software, Inc. Shares: 1000 Purchase/share: $45.50 Cost of stock: $45500.00 Cost of commission: $1592.50 Total cost: $47092.50 Sale/share: $56.90 Income from stock: $56900.00 Cost of commission: $1991.50 Total income: $54908.50 Gain or loss: $7816.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago

Question

Explain product positioning.

Answered: 1 week ago

Question

Explain Industrial market segment.

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago