Question

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 ofshares and stock symbol. 2. The amount paid for the stock alone (without the commission) 3. The amount of the commission 4. The total amount paid (for the stock plus the commission) If your algorithm has numbers in it, replace them with variables or named constants so that it can be reused for other data. Example: 150 shares of Apple (AAPL) at $145.63. Calculate the profit (or loss) when the stock purchased is then sold (must pay commission again). Allow the user to be able to enter the number of shares, stock symbol, purchase price and sale price (in that order). Display all information entered, amount paid for stock, amount received from sale, commissions paid, profit (or loss), % gain (or loss) labeled and numbers all right justified in one column.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Algorithm:

Inputs:--N:number of shares,sc:per share cost,c:Commision percentage

Steps:

1.Read N.In this case N=750

2.Read per share cost,In this case sc=70.43

3.Read Commission percentage,In this case c=2%=>0.02

4.Evaluate Amount to be paid without commission=number of shares*per share cost

=750*70.43

=52822.5

5.Evaluate Commission cost=Commission percentage*number of shares*per share cost

=0.02*750*70.43

=1056.45

6.Evaluate Amount to be paid with commission=Amount to be paid without commission+Commission cost

=53878.95

7.Display N and stock symbol "$".==>750 $

8.Display Amount to be paid without commission.==>52822.5$

9.Display Commission cost==>1056.45$

10.Display Amount to be paid with commission.==>53878.95 $

11.Read number shares to be sold N'.

12.Read stock Symbol.

13.Read purchase price(cp) and sale price(sp).

14.Evaluate Commission cost=Commission percentage*number of shares N' *per share cost

=0.02* N' * 70.43

14.Evaluate Purchase Price=Commsion cost+number of shares N' *per share cost

15.Evaluate Selling Price=Commsion cost+number of shares N' *per share cost

16.Evaluate profit%=N' * 100 * (cp-sp)/cp

Add a comment
Know the answer?
Add Answer to:
With a partner, use the problem solving approach covered on day 1. Write out an algorithm...
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...

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

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

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

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

  • C++ (i) Write a program that displays the following pattern: * *** ***** ******* ***** ***...

    C++ (i) Write a program that displays the following pattern: * *** ***** ******* ***** ***    * (ii) Katy bought 750 shares of stock at a price of $35.00 per share. She must pay her stockbroker a 2 percent commission for the transaction. Write a program that calculates and displays the following: The amount paid for the stock alone (without the commission) The amount of the commission) The total amount paid (stock plus commission) (iii) Write a program that...

  • 201: Lab A 1. Download Eclipse onto your computer 2. Please follow this link if you are having trouble in installing Ecl...

    201: Lab A 1. Download Eclipse onto your computer 2. Please follow this link if you are having trouble in installing Eclipse. https://www.youtube.com/watch?v=TXbuATMlVNY&index=19&list=PL_v5Vo_UXw aHWOr2I9dq7DxI6Iw3eQzOd 3. Sample code #include <iostream> using namespace std; int main () { cout << "Hello world\n"; return 0; } Problem 2-1: Write a program that ask the user for the flowing: How many shares to be bought: The price per share: Percent commission for the broker for each transaction: Average annual return as of percentage: The...

  • Mr. N. Vestor owns several different stocks. Data regarding these stocks can be found in a...

    Mr. N. Vestor owns several different stocks. Data regarding these stocks can be found in a plain text file. Write a program that will read specific information from the file and display that information to the screen. AMZN~Amazon.Com Inc~1,402.05~+24.10~+1.75%~4,854,900~6,806,813~01/26/18~1523 AAPL~Apple Inc~171.51~+0.40~+0.23%~39,128,000~6,710,843~01/26/18~1224 BABA~Alibaba Group Holding Ltd~205.22~+6.89~+3.47%~23,757,801~4,875,576~01/26/18~100 INTC~Intel Corp~50.08~+4.78~+10.55%~86,903,102~4,352,107~01/26/18~2213 VMW~Vmware Inc~150.00~+12.37~+8.99%~27,806,600~4,170,990~01/26/18~1745 WYNN~Wynn Resorts Ltd~180.29~-20.31~-10.12%~22,140,102~3,991,639~01/26/18~500 FB~Facebook Inc~190.00~+2.52~+1.34%~17,745,000~3,371,550~01/26/18~750 NVDA~Nvidia Corp~243.33~+6.98~+2.95%~12,902,001~3,139,444~01/26/18~1195 NFLX~Netflix Inc~274.60~+4.90~+1.82%~11,016,300~3,025,076~01/26/18~812 SBUX~Starbucks Corp~57.99~-2.56~-4.23%~51,846,000~3,006,550~01/26/18~915 DVMT~Dell Technologies Inc Cl V~82.74~-5.70~-6.45%~35,703,301~2,954,091~01/26/18~1611 MSFT~Microsoft Corp~94.06~+1.73~+1.87%~29,168,799~2,743,617~01/26/18~1751 GOOGL~Alphabet Class A~1,187.56~+5.42~+0.46%~2,107,300~2,502,545~01/26/18~2462 ABBV~Abbvie Inc~123.21~+14.91~+13.77%~19,614,201~2,416,666~01/26/18~10 GOOG~Alphabet Class C~1,175.84~+5.47~+0.47%~2,018,300~2,373,198~01/26/18~1675 PFE~Pfizer Inc~39.01~+1.78~+4.78%~48,805,004~1,903,883~01/26/18~55 The pieces of...

  • Help solving these problems a for-profit hospital, has $1 million END-OF-CHAPTER PROBLEM in taxabe income for...

    Help solving these problems a for-profit hospital, has $1 million END-OF-CHAPTER PROBLEM in taxabe income for 2016, and its tax rate is 30 percent. a. Given this information, what is the firm's net income2 (Net income is what remains after taxes have been paid.) b. Suppose the hospital pays out $300,000o in divide areholder, Carl n dividends is 15 percent, what is his receives St0,00o. If Carl's tax rate on dividends is the stock of another corporation does not have...

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