Demonstrate the function in a program that asks the user to


Stock Profit

The profit from the sale of a stock can be calculated as follows:

1537_e2818fd4-5d11-4c24-8655-33e0f6f235c1.png

where NS is the number of shares, SP is the sale price per share, SC is the sale commission paid, PP is the purchase price per share, and PC is the purchase commission paid. If the calculation yields a positive value, then the sale of the stock resulted in a profit. If the calculation yields a negative number, then the sale resulted in a loss. Write a function that accepts as arguments the number of shares, the purchase price per share, the purchase commission paid, the sale price per share, and the sale commission paid. The function should return the profit (or loss) from the sale of stock.

Demonstrate the function in a program that asks the user to enter the necessary data and displays the amount of the profit or loss.

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Demonstrate the function in a program that asks the user to
Reference No:- TGS01645636

Expected delivery within 24 Hours