Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON QUESTION Then write( handwritten ok) a simple python(python 3) program to simulate a simple stock transaction. Ask the user for the starting price per

PYTHON QUESTION

Then write( handwritten ok) a simple python(python 3) program to simulate a simple stock transaction.

Ask the user for the starting price per share of a stock.

starting_price = float(input("What is the starting price per share?: "))

Ask the user how many shares the user wants to buy and read into a variable called numShares.

Then you want to multiply those two variables to get cost. Then take cost multiplied by 1.10(this represents the commission for stock broker) .

Print this total cost out.

print(Total cost is ,totalcost)

Then ask the user to enter the ending price.

Then print out the profit by taking (ending price * number of shares)- total cost.

Print out the profit.

Done.

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions