Programming assignment question

Write your question here.
Description:
In this assignment, you will develop a C++ program that calculates gain or loss of a stock you purchased. Go to the website “Yahoo! Finance” and select a technology stock for your assignment. Some examples of technology stocks include Apple, Cisco, IBM, Teradata, etc….

In your program, the user will enter the following pieces of information:

• the name of the stock
• the stock symbol
• the number of shares purchased
• the purchase price
• the commission paid

Requirements for Your Program:

Here are additional requirements for your program:

1. Have the user enter the company name and stock symbol
2. Have the user enter the number of shares purchased
3. Have the user enter the price per share, sharePrice.
4. Calculate the sharesCost which is the number of shares * price per share
5. When you purchase stock you need to pay a commission based on the number of shares purchased times the purchase price. Multiply the commission rate times shareCost.
6. Add the sharesCost to the commission to calculate total cost of purchase

I'm currently stuck on step 5, I don't understand how to get the commission rate. How would you calculate commission rate? I've emailed my professor but it's been a few days and with no response. Thanks in advance for the assistance.
"When you purchase stock you need to pay a commission based on the NUMBER OF SHARES TIMES the PURCHASE PRICE."

It seems like your professor words things in a more complicated fashion than need be. All he seemingly indicates is that "you need to pay a commission."

For this very sake, I would just tell you to create your own commission. Choose a number and multiply. Let's say, 6%. Step 5 + 6 combined: (1.06 * sharesCost). Or, you could just do Step 6: (sharesCost * .06) + (sharesCost).

(1.06 * sharesCost) does steps 5 + 6 for you.

Why does this seem so simple? Sometimes as programmers, we tend to overlook the simplicity in life. We're all guilty of it. Hope this helps.
Last edited on
This helps immensely thank you so much! I would have to agree I am always overlooking the simplicity of a situation or problem.
Topic archived. No new replies allowed.