Question

Write a program based on the following flow chart and test the same for correct results? 2 points for each correct results as

Start Display Amount paid for stock: $, Constant Real Set totalPaid COMMISSION RATE= 0.03 Constant Integer NUM SHARES 2000

Write a program based on the following flow chart and test the same for correct results? 2 points for each correct results as follows Amount paid for the stock: 80000.00 Commission paid on the purchase: 2400.00 Amount the stock sold for 85500.00 Commission paid on the sale 2565.00 Profit (or loss if negative) 535.00
Start Display "Amount paid for stock: $", Constant Real Set totalPaid COMMISSION RATE= 0.03 Constant Integer NUM SHARES 2000 Constant Real PURCHASE PRICE 40.0 amountPaidForStock+ purchaseCommission amountPaidFor Stock Set stockSoldFor Display "Commission NUM_SHARES SELLING PRICE Constant Real SELLING PRICE=42.75 paid on the purchase: $", purchaseComm ission Declare Real amountPaidForStock Declare Real Set sellingCommission COMMISSION RATE stockSoldFor purchaseCommission Declare Real totalPaid Declare Real stockSoldFor Declare Real Display Amount the stock sold for: sellingCommission Declare Real Set tota!Received stockSoldFor sellingCommission stockSoldFor totalReceived Declare Real profitOrLoss Display “Commission paid on the sale: $" sellingCommissi Set amountPaid ForStock = Set profitOrLoss totalReceived totalPaig NUM_SHARES PURCHASE PRICE on Display "Profit (or loss if negative): S, profitOrLoss Set purchaseCommission =COMMISSION RATE * amountPaidForStock End
0 0
Add a comment Improve this question Transcribed image text
Answer #1

PROGRAM USING PYTHON:

COMMISSION_RATE = 0.03;
NUM_SHARES = 2000;
PURCHASE_PRICE = 40.0;
SELLING_PRICE = 42.75;

amountPaidForStock = NUM_SHARES * PURCHASE_PRICE;
purchaseCommission = COMMISSION_RATE * amountPaidForStock;

totalPaid = amountPaidForStock + purchaseCommission;

stockSoldFor = NUM_SHARES * SELLING_PRICE;

sellingCommission = COMMISSION_RATE * stockSoldFor;

totalReceived = stockSoldFor - sellingCommission;

profitOrLoss = totalReceived - totalPaid;

print("Amount paid for stock: $", amountPaidForStock)
print("Commission paid on the purchase: $", purchaseCommission)
print("Amount the stock sold for: $", stockSoldFor)
print("Commission paid on the sale: $", sellingCommission)
print("Profit (or loss if negative): $", profitOrLoss)

OUTPUT:
C:\Users\Shubham\ PycharmProjects\hello\venv\Scripts\python.exe C:/Users/Shubham/ PycharmProjects/hello/venv/first.py Amount

Add a comment
Know the answer?
Add Answer to:
Write a program based on the following flow chart and test the same for correct results? 2 points for each correct res...
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
  • (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...

  • With a partner, use the problem solving approach covered on day 1. Write out an algorithm...

    With a partner, use the problem solving approach covered on day 1. Write out an algorithm on paper along with hand calculations to determine expected output. Add onto the algorithm from Problem Solving Challenge 1. Kathryn bought 750 shares of Microsoft Corporation (MSFT) stock at a price of $70.43 per share. She must pay her stock broker a 2% commission for the transaction. The algorithm should calculate and display the following: 1. The number of shares and stock symbol. 2....

  • 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...

  • 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...

  • 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...

  • write a c++ program. A real estate broker sets fees for selling properties according to the...

    write a c++ program. A real estate broker sets fees for selling properties according to the property type as shown in the table. The broker wants you to write a program that prompts the user for the broker type, sale price of the property and the property code. If the user enters an invalid property code or broker code, the program should display an appropriate message and end the program. Allow the user to enter uppercase and lowercase letters. If...

  • This question has been answered before, but please understand that the display has to be exactly...

    This question has been answered before, but please understand that the display has to be exactly like the one I have on here. Please read carefully and try to help me achieve that display (PLEASE READ THE OUTCOME SECTION AND TRY TO MAKE IT EXACT TO THAT): Next you will read in the number of shares of stock, a stock purchase price, and a stock sale price. The number of shares will always be an integer value. With this data...

  • Requires Python to answer A client wishes to keep track of his investment in shares. Write...

    Requires Python to answer A client wishes to keep track of his investment in shares. Write a program to help him manage his stock portfolio. You are to record both the shares that he is holding as well as shares that he has sold. For shares be is curreatly holding, record the following data: .a 3-character share code, share name, last purchase date, volume currently held and average purchase price (refer to description under part cii) option 2) For shares...

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