Write a program named SellStocks (.java) that calculates the value of a stock sale. The user will be prompted to enter the stock price, the number of shares to be sold, and the commis- sion rate. The program will calculate the value of the shares by muluplying the stock price by the number of shares. It will also calculate the commission (the value of the shares multi-
Write a
will be prompted to enter the stock price, the number of shares to be sold, and the commis-
sion rate. The program will calculate the value of the shares by muluplying the stock price
by the number of shares. It will also calculate the commission (the value of the shares multi-
plied by the commission rate) and the net proceeds (the value of the shares minus the com-
mission). The tollowing example shows what the user will see on the screen:
This program calculates the net proceeds from a sale of stock.
Enter stock price: 10.125
Enter number of shares: 11
Value of shares: $111.38
Enter commission rate (as a percentage): 1.5
Commission: $1.67
Net proceeds: $109.71
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images