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-

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

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-
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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT