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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education