Question

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 stock for $56.90 per share. He paid his stockbroker another commission that amounted to 2% of the amount 
he received for the stock.
Write a C program that displays the following information: The amount of money Joe paid for the stock. The amount of commission Joe paid his broker when he bought the stock. The amount that Joe sold the stock for. The amount of commission Joe paid his broker when he sold the stock. Display the amount of profit that Joe made after selling his stock and paying the two 
commissions to his broker. (If the amount of profit that your program displays is a negative number, then Joe lost money on the transaction.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

int main()
{
   int num_of_stocks = 1000; // number of shares
   double cost = 45.50; // cost of each share
   double total_cost = cost*num_of_stocks; // total cost of shares
   double buy_commision = total_cost*0.02; // buying commission
   double buy_amount = total_cost + buy_commision; // total amount Joe paid

   double sold = 56.90; // selling price of each share
   double money_received = num_of_stocks*sold; // money Joe get after selling
   double sold_commision = money_received*0.02; // money Joe paid to broker
   double final_amount = money_received - sold_commision; // in-hand money of Joe

   printf("Joe bought stock for $%.2lf ", total_cost);
   printf("Joe paid commission when buying: $%.2lf ", buy_commision);
   printf("Joe sold stock for $%.2lf ", money_received);
   printf("Joe paid commission when selling: $%.2lf ", sold_commision);
   printf(" Final Money Joe received: $%.2lf ", final_amount-buy_amount);

   return 0;
}

OUTPUT

Add a comment
Know the answer?
Add Answer to:
Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the...
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...

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

  • Please take a screenshot or picture of work done in the PYTHON SHELL to see steps....

    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 details of the purchase: • The number of shares that Joe purchased was 2000. • When Joe purchased the stock, he paid $40.00 per share. • Joe paid his stockbroker a commission that amounted to 3 percent of the amount...

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

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

  • Tammy Jackson purchased 119 shares of All-American Manufacturing Company stock at $34.10 a share. One year...

    Tammy Jackson purchased 119 shares of All-American Manufacturing Company stock at $34.10 a share. One year later, she sold the stock for $41 a share. She paid her broker a $29 commission when she purchased the stock and a $52 commission when she sold it. During the 12 months she owned the stock, she received $225 in dividends. Calculate Tammy’s total return on this investment. (Round all intermediate calculations and final answer to the nearest whole number)

  • Tammy Jackson purchased 106 shares of All-American Manufacturing Company stock at $39.30 a share. One year...

    Tammy Jackson purchased 106 shares of All-American Manufacturing Company stock at $39.30 a share. One year later, she sold the stock for $45 a share. She paid her broker a $33 commission when she purchased the stock and a $48 commission when she sold it. During the 12 months she owned the stock, she received $162 in dividends. Calculate Tammy’s total return on this investment. (Round all intermediate calculations and final answer to the nearest whole number.)

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

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

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