Question: Write an application that queries the user for their name and the following information about a stock transaction and then displays the net gain (or
Write an application that queries the user for their name and the following information about a stock transaction and then displays the net gain (or loss) on the transaction. The feedback to the user should follow this format. Thanks for your recent transaction (NAME). The net gain on your transaction is $XX.XX. 1. Number of shares bought and sold (this is one number not two) 2. Purchase price per share 3. Purchase commission as a double (for example, 2% commission would be 0.02) 4. Sale price per share 5. Sale commission as a double (for example, 2% commission would be 0.02) You must allow the user to enter the values. However you can use the following numbers to check your lab Shares = 1000 Purchase price = $45.2 Purchase commission = 2% or 0.02 Sale price = $46.5 Sale commission = 2% or 0.02 Net gain of -$534
Language: java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
