Question: Please us JAVA as a programming language. sharePrice = (Number_of_shares * Purchase_price ) - (Number_of_shares * Sale_price ) ; commissionTotal = (Number_of_shares * Purchase_price *
Please us JAVA as a programming language.
sharePrice = (Number_of_shares * Purchase_price ) - (Number_of_shares *
Sale_price ) ;
commissionTotal = (Number_of_shares * Purchase_price *
Purchase_commission )+ (Number_of_shares * Sale_price * Sale_commission );
net_Price = commissionTotal + sharePrice ;
Write an application that queries the user for the following information about a stock transaction and then displays the net gain or loss on the transaction.
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 loss of $534
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
