Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Cindy uses the services of a brokerage firm to buy and sell stocks. The firm cha

ID: 668514 • Letter: C

Question

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.

Perform an analysis and design for this problem. Write the code, compile and test it.

Write from the perspective of a beginner program and in C++ format

Explanation / Answer

#include #include using namespace std; int main(){ const double BROKERAGE_FEE = 0.015; double purchasePrice, salePrice, netAmount, originalInvestment, totalFees; int sharesSold; cout > sharesSold; cout > salePrice; cout > purchasePrice; originalInvestment = sharesSold * purchasePrice; totalFees = (sharesSold * salePrice) * BROKERAGE_FEE; netAmount = (sharesSold * salePrice) - totalFees; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote