Two months later the person sold the numbershares shares at


Problem Description:

A person purchased numberShares shares of Buffalo Wild Wings (BWLD) stock at the price of buyPrice per share and paid the stockbroker $15 transaction fee.

Two months later, the person sold the numberShares shares at sellPrice per share and paid another $15 for the transaction.

Write a Java program to calculate and display the following:

1. The dollar amount paid for the shares

2. The dollar amount of the shares sold

3. The total transaction fee paid to the broker (including both buy and sale)

4. The amount of profit (or loss) made after selling the shares.

The values of numberShares, buyPrice, sellPrice are input from the user.

For example, if the interactive execution looks like this (user's inputs are shown in bold):

How many shares bought? 150

Buy price? 44.83

Sell price? 46.54

The output generated by your program should like this:

Here is the information of your stock transactions

Number of shares: 150

Amount of purchase: $6724.50

Amount of sell: $6981.00

Transaction fee paid: $30.00

Net profit: $226.50

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Two months later the person sold the numbershares shares at
Reference No:- TGS02898415

Expected delivery within 24 Hours