Answer to Question #302450 in Java | JSP | JSF for shruti

Question #302450

Swati bought 600 shares of stock at a price of Rs 20 per share. She must pay her stock broker a 2% commission for the transaction.


Write a program that the display the following:

-The amount paid for the stock alone (without the commission)

-The amount of the commission

-The total amount paid 


1
Expert's answer
2022-02-25T10:29:29-0500
public class Main {
    public static void main(String[] args) {
        int sharesOfStock = 600;
        System.out.println("The amount paid for the stock alone (without the commission): " + sharesOfStock * 20);
        System.out.println("The amount of the commission: " + (sharesOfStock * 20) * 0.02);
        System.out.println("The total amount paid: " + (sharesOfStock * 20) * 1.02);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS