Assignment 1

Due date: 2/1 at 5pm.

Your assignment for this week is to write a program that computes the profit (or loss) in a stock transaction and prints it to the screen.

Get from the user the following input:

  • The price for which the stock was purchased.
  • The number of shares bought
  • The price for which the stock was sold.

The formula for computing the profit/loss is:
(price sold - price bought) * number of shares - purchase commission - selling commission

Assume that there is a $7 commission for both buying and selling a stock.

Store your program in a file called assignment1.py and submit it via RamCT. At the top of the file put a comment that identifies you and the program:

Assignment1
Submitted by Your_Name
A short description of your program