Question

Please use C++ only CSIT163 Project 1 - Taking Stock Recently, Joe Btfsplk purchased some stock in Acme Software, Inc. The details of the purchas

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

Answer is after the screenshot of the output

Feel free to clear any doubts :)

ANSWER:

#include<iostream>

#include<iomanip>

//iomanip is included to use fixed and setprecision

using namespace std;

int main()

{

//declare float variables

float buying_price,selling_price,profit,n,fees;

//take input from user

cout<<"Enter buying price of stock(per stock)\n";

cin>>buying_price;

cout<<"Enter number of stocks bought\n";

cin>>n;

cout<<"Enter selling price of stock(per stock)\n";

cin>>selling_price;

//fees is $5 for purchase, $5 for selling and 2% of total values of stocks bought/sold

fees=10.0+(0.02*buying_price*n)+(0.02*selling_price*n);

//profit is profit gained by selling stocks- fees

profit=((selling_price-buying_price)*n)-fees;

//print the result on the screen, setprecision sets number of digits after decimal point.

//fixed is used to display in normal floating point notation instead of exponential notation

cout<<"Total profit gained(negative if lost): "<<setprecision(2)<<fixed<<profit<<endl;

return 0;

}

Add a comment
Know the answer?
Add Answer to:
Please use C++ only CSIT163 Project 1 - Taking Stock Recently, Joe Btfsplk purchased some stock...
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 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...

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

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

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

  • Jackie Artmeyer has purchased the stock of a firm. The firm paid an annual dividend of...

    Jackie Artmeyer has purchased the stock of a firm. The firm paid an annual dividend of $.65. Its earnings per share was $2.00. This stock is selling in the market for $31. What is this firm's dividend payout ratio? Multiple Choice 30.77 percent 2.65 percent 15.50 percent 32.50 percent None of the above is correct. If the board of directors approves a two for one stock split, an investor who owns 280 shares before the split owns ____________ shares after...

  • Jackie Artmeyer has purchased the stock of a firm. The firm paid an annual dividend of...

    Jackie Artmeyer has purchased the stock of a firm. The firm paid an annual dividend of $.65. Its earnings per share was $2.00. This stock is selling in the market for $31. What is this firm's dividend payout ratio? Multiple Choice 30.77 percent 2.65 percent 15.50 percent 32.50 percent None of the above is correct. If the board of directors approves a two for one stock split, an investor who owns 280 shares before the split owns ____________ shares after...

  • Joe Martinez, a U.S. citizen living in Brownsville, Texas, invested in the common stock of Telmex,...

    Joe Martinez, a U.S. citizen living in Brownsville, Texas, invested in the common stock of Telmex, a Mexican corporation. He purchased 4,000 shares at 21.00 pesos per share. Twelve months later, he sold them at 29.75 pesos International investment returns Personal Finance Problem per share. He received no dividends during that time. a. What was Joe's investment return (in percentage terms) for the year, on the basis of the peso value of the shares? b. The exchange rate for pesos...

  • Two years ago, you purchased 100 shares of Coca-Cola Company. Your purchase price was $52 a...

    Two years ago, you purchased 100 shares of Coca-Cola Company. Your purchase price was $52 a share, plus a total commission of $35 to purchase the stock. During the last two years, you have received the following dividend amounts: $1.10 per share for the first year and $1.18 per share the second year. Also, assume that at the end of two years, you sold your Coca-Cola stock for $60 a share minus a total commission of $35 to sell the...

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