Final answer:
A program can be written to calculate the gains/losses generated by a stock investment using the given information.
Step-by-step explanation:
A program can be written to calculate the gains/losses generated by a stock investment using the given information. The program should prompt the user for the company name and symbol, number of shares transacted, cost per share at the time of buying, and price per share at the time of selling. The program can then calculate the net profit by subtracting the total cost of buying from the total revenue from selling. The net profit can be displayed to the user.