Problem Statement for Stock Transaction Program George uses the services of a brokerage firm to buy and sell stocks. Each time he buys or sells a block of stocks, he must pay the brokerage firm a commission of 1.5% per share.Design a program that allows George to enter the number of shares in the block, the price per share when he bought the block and the price per share when he sold the block. The program should display the amount of money he paid to buy the stock and the amount of the commission. The amount of money he made when he sold the stock and the amount of the commission, the amount of profit (or loss) he madeafter paying for the purchase cost and both commissions. There are three user inputs for this problem: the number of shares in the block, the price per share when the block was bought, the price per share when the block was sold. There is one constant: the percentage of the commission (1.5%) The amount to buy the stock is: number of shares in block * purchase price per shareThe commission for the purchase is: the amount spent * commission percentage/100The amount received when the stock was sold is: number of shares * selling price per shareThe commission for the sale is: the amount received * commission percentage / 100The profit would be: amount received -(amount spent + commission for purchase + commission for sale) Asa test case assume that George bought a block of 1000 shares of a stock at $25.63 per share. Six months later, he sold the block of 1000 shares for $31.27 per share. The amount spent to buy is 1000 * 25.63 =25630The commission on the purchase is 25630 * .015 = 384.45The amount received when sold is 1000 * 31.27 = 31270The commission on the sale is 31270 * .015 = 469.05The amount of profit George received is 31270 -(25630 + 384.45 + 469.05) = 4786.5 (PYTHON)

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
Question

Problem Statement for Stock Transaction Program

George uses the services of a brokerage firm to buy and sell stocks. Each time he buys or sells a block of stocks, he must pay the brokerage firm a commission of 1.5% per share.Design a program that allows George to enter the number of shares in the block, the price per share when he bought the block and the price per share when he sold the block. The program should display the amount of money he paid to buy the stock and the amount of the commission. The amount of money he made when he sold the stock and the amount of the commission, the amount of profit (or loss) he madeafter paying for the purchase cost and both commissions.

There are three user inputs for this problem: the number of shares in the block, the price per share when the block was bought, the price per share when the block was sold.

There is one constant: the percentage of the commission (1.5%)

The amount to buy the stock is: number of shares in block * purchase price per shareThe commission for the purchase is: the amount spent * commission percentage/100The amount received when the stock was sold is: number of shares * selling price per shareThe commission for the sale is: the amount received * commission percentage / 100The profit would be: amount received -(amount spent + commission for purchase + commission for sale)

Asa test case assume that George bought a block of 1000 shares of a stock at $25.63 per share. Six months later, he sold the block of 1000 shares for $31.27 per share.

The amount spent to buy is 1000 * 25.63 =25630The commission on the purchase is 25630 * .015 = 384.45The amount received when sold is 1000 * 31.27 = 31270The commission on the sale is 31270 * .015 = 469.05The amount of profit George received is 31270 -(25630 + 384.45 + 469.05) = 4786.5

(PYTHON)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
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