Question
Please take a screenshot or picture of work done in the PYTHON SHELL to see steps. Thank you.
• Make sure to test your program before submit. Last month, Joe purchased some stock in Acme Software, Inc. Here are the deta
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Create file named as ShareCalculation.py and copy the below code:

#program to Show Calculation for Shares

def ShareCalculation():

    numberOfShares = 2000     #number of shares Joe bought

    purchasePrice = 40.00     #Puchase price of the share

    commissionPercentage = 3 # commission percentage of broker

    sellingPrice = 42.75      # Selling price of the share

   

    # total purchase price is number of shares * purchase price

    totalPurchasePrice = numberOfShares * purchasePrice

   

    # commision for buying the share is 3% of the total purchase price

    commissionForBuying = totalPurchasePrice * (commissionPercentage /100)

   

    # total Selling price is number of shares * selling price

    totalSellingPrice = numberOfShares * sellingPrice

   

    # commision for buying the share is 3% of the total selling price

    commissionForSelling = totalSellingPrice * (commissionPercentage/100)

   

    #left amount is total selling Price - commission paid to broker for selling

    leftAmount = totalSellingPrice - commissionForSelling

   

    print("The amount of money Joe paid for the stock: " + str(totalPurchasePrice))

    print("The amount of commission Joe paid his broker when he bought the stock: " + str(commissionForBuying))

    print("The amount for which Joe sold the stock: " + str(totalSellingPrice))

    print("The amount of commission Joe paid his broker when he sold the stock: " + str(commissionForSelling))

    print("The amount of money that Joe had left when he sold the stock and paid his broker: " + str(leftAmount))

# main program calling the Share Calculation function

ShareCalculation()

Screen shot for code is for your reference and for indentation purpose:

Open command prompt and type the command python ShareCalculation.py.

Output:

In case of any query, do comment.

Please rate your answer. Thanks

Add a comment
Know the answer?
Add Answer to:
Please take a screenshot or picture of work done in the PYTHON SHELL to see steps....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 10. Stock Transaction Program 18pts Last month Joe purchased some stock in Acme Software, Inc. Here...

    10. Stock Transaction Program 18pts Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase: • The number of shares that Joe purchased was 1,000. • When Joe purchased the stock, he paid $32.87 per share. • Joe paid his stockbroker a commission that amounted to 2 percent of the amount he paid for the stock. Two weeks later Joe sold the stock. Here are the details of the sale: • The number...

  • Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the...

    Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase: The number of shares that Joe purchased was 1,000. When Joe purchased the stock, he paid $45.50 per share. Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock Two weeks later Joe sold the stock. Here are the details of the sale: The number of shares that Joe sold was 1,000. He sold the...

  • Please use C++ only CSIT163 Project 1 - Taking Stock Recently, Joe Btfsplk purchased some stock...

    Please use C++ only CSIT163 Project 1 - Taking Stock Recently, Joe Btfsplk purchased some stock in Acme Software, Inc. The details of the purchase are as follows: • 1,000 shares at $32.87 per share. • The stockbroker received $5 dollars plus a commission of 2% of the total purchase. Should he decide to sell, the stockbroker receives $5 dollars plus a commission of 2% of the total sale. Feeling jittery, Joe is considering selling the stock. The only thing...

  • (PYTHON) Stock Transaction Program Last month Joe purchased some stock from StockTrade.   1. Write a function(s)...

    (PYTHON) Stock Transaction Program Last month Joe purchased some stock from StockTrade.   1. Write a function(s) to allow the user to input the followings: ·The name of the stock ·Number of shares Joe bought · Stock purchase price · Stock selling price ·Broker commission 2. Write function(s) to calculate: and: · The amount of money Joe paid for the stock (number of shares bought * purchase price) · The amount of commission Joe paid his broker when he bought the...

  • Problem Statement Last month Tian purchased some stock in Acme Software, Inc. Here are the details...

    Problem Statement Last month Tian purchased some stock in Acme Software, Inc. Here are the details of the purchase:  The number of shares that Tian purchased was 1,000  When Tian purchased the stock, he paid $33.92 per share  Tian paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock. One week later, Tian sold the stock. Here are the details of the sale: The number of shares sold was 1,000...

  • walk me through all of these problems Selling Stocks When you sell your stocks, the sale...

    walk me through all of these problems Selling Stocks When you sell your stocks, the sale can result in either a profit or a loss. You profit when the sale amoun minus the sales commission is greater than the original purchase amount. Your sale results in a loss when the sale amount minus the sales commission is less than the original purchase amount NET SALE - AMOUNT OF SALE COMMISSION PROFIT - NET SALE TOTAL PAID LOSS - TOTAL PAID...

  • Required information (The following information applies to the questions displayed below.) John bought 2,050 shares of...

    Required information (The following information applies to the questions displayed below.) John bought 2,050 shares of Intel stock on October 18, 2015, for $51 per share plus a $750 commission he paid to his broker. On December 12, 2019, he sells the shares for $74.00 per share. He also incurs a $1,000 fee for this transaction. a. What is John's adjusted basis in the 2,050 shares of Intel stock? Adjusted basis Required information The following information applies to the questions...

  • ! Required information [The following information applies to the questions displayed below.) John bought 1,600 shares...

    ! Required information [The following information applies to the questions displayed below.) John bought 1,600 shares of Intel stock on October 18, 2015, for $42 per share plus a $750 commission he paid to his broker. On December 12, 2019, he sells the shares for $60.50 per share. He also incurs a $1,000 fee for this transaction. a. What is John's adjusted basis in the 1,600 shares of Intel stock? Adjusted basis Required information [The following information applies to the...

  • Required information [The following Information applies to the questions displayed below.) John bought 2,000 shares of...

    Required information [The following Information applies to the questions displayed below.) John bought 2,000 shares of Intel stock on October 18, 2014, for $50 per share plus a $750 commission he paid to his broker. On December 12, 2018, he sells the shares for $72.50 per share. He also incurs a $1,000 fee for this transaction. a. What is John's adjusted basis in the 2,000 shares of Intel stock? Adjusted basis Required Information [The following information applies to the questions...

  • please walk me through the rest of the problems When you purchase a share of stock,...

    please walk me through the rest of the problems When you purchase a share of stock, you become a part owner of the company that issues the stock. The total amount you pay for the stock depends on the cost per share, the number of shares you purchase, and the stockbroker's commission. When you buy stock, you may receive dividends. If you consider annual dividends an important factor in investing, you can use the annual yield to compare different stocks...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT