Hi! Im working on a homework assignment: Cindy uses the services of a brokerage firm to buy and sell stocks. The firm charges 1.5% service charges on the total amount for each transaction, buy or sell. When Cindy sells stocks, she would like to know if she gained or lost on a particular investment. Write a program that allows Cindy to input the number of shares sold, the purchase price of each share, and the selling price of each share. The program outputs the amount invested, the total service charges, amount gained or lost, and the amount received after selling the stock.
I've written my code however my test data seems to be inaccurate. Are my equations correct? They seem to be.
Shares sold: 1
Purchase price: 2
Sale Price: 3
Total amount gained/lost: 2.96 (which seems false)