Write a program that can make these calculations for


Problem

Suppose you buy 100 shares of a stock at $12 per share, then another 100 at $10 per share, and then sell 150 shares at $15. You have to pay taxes on the gain, but exactly what is the gain? In the United States, the FIFO rule holds: You first sell all shares of the first batch for a profit of $300, then 50 of the shares from the second batch, for a profit of $250, yielding a total profit of $550. Write a program that can make these calculations for arbitrary purchases and sales of shares in a single company. The user enters commands buy quantity price, sell quantity (which causes the gain to be displayed), and quit.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that can make these calculations for
Reference No:- TGS02636954

Expected delivery within 24 Hours