1. Write a program that helps a stock market investor understand how much they've made when selling Acme Software, Inc. stock. 2. Ask your user how many shares of Acme Software, Inc. they purchased. 3. And ask your user how much they paid per share. 4. Then, assume that your user sold the same number of shares they had purchased some time later. 5.Ask your user at what price they sold the shares. 6. In both instances, the purchase and sale, your user had to pay their stockbroker a commission that amounted to 2% of the amount paid for the stock as well as the amount received for the stock. 7.Then, display: a) The amount your user paid for the stock. b) The amount of commission your user paid their stockbroker when they bought the stock. c) The amount your user sold the stock for. d) The amount of commission your user paid their stockbroker when they sold the stock. e) The amount of profit that your user made after selling the stock and paying the two commissions to their broker. (Important note: If the amount of profit that your program displays is a negative number, then your user lost money on the transaction.) Other coding notes: 1. Make it simple and use variables of type double for the number of shares, the dollar amounts and the commission (0.02 == 2%). 2. A very complete program might use an if statement or two.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 23PE
icon
Related questions
icon
Concept explainers
Question

1. Write a program that helps a stock market investor understand how much they've made when selling Acme Software, Inc. stock.
2. Ask your user how many shares of Acme Software, Inc. they purchased.
3. And ask your user how much they paid per share.
4. Then, assume that your user sold the same number of shares they had purchased some time later.
5.Ask your user at what price they sold the shares.
6. In both instances, the purchase and sale, your user had to pay their stockbroker a commission that amounted to 2% of the amount paid for the stock as well as the amount received for the stock.
7.Then, display:
a) The amount your user paid for the stock.
b) The amount of commission your user paid their stockbroker when they bought the stock.
c) The amount your user sold the stock for.
d) The amount of commission your user paid their stockbroker when they sold the stock.
e) The amount of profit that your user made after selling the stock and paying the two commissions to their broker.

(Important note: If the amount of profit that your program displays is a negative number, then your user lost money on the transaction.)

Other coding notes:
1. Make it simple and use variables of type double for the number of shares, the dollar amounts and the commission (0.02 == 2%).
2. A very complete program might use an if statement or two. 

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

hello, i forgot to mention, i need the program in java

----

1. Write a program that helps a stock market investor understand how much they've made when selling Acme Software, Inc. stock.
2. Ask your user how many shares of Acme Software, Inc. they purchased.
3. And ask your user how much they paid per share.
4. Then, assume that your user sold the same number of shares they had purchased some time later.
5.Ask your user at what price they sold the shares.
6. In both instances, the purchase and sale, your user had to pay their stockbroker a commission that amounted to 2% of the amount paid for the stock as well as the amount received for the stock.
7.Then, display:
a) The amount your user paid for the stock.
b) The amount of commission your user paid their stockbroker when they bought the stock.
c) The amount your user sold the stock for.
d) The amount of commission your user paid their stockbroker when they sold the stock.
e) The amount of profit that your user made after selling the stock and paying the two commissions to their broker.

(Important note: If the amount of profit that your program displays is a negative number, then your user lost money on the transaction.)

Other coding notes:
1. Make it simple and use variables of type double for the number of shares, the dollar amounts and the commission (0.02 == 2%).
2. A very complete program might use an if statement or two. 

 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning