Answer to Question #143073 in Java | JSP | JSF for Hamza saeed

Question #143073
. To make a profit, a local store marks up the prices of its items by a certain
percentage. Write a Java program that reads the original price of the item
sold, the percentage of the marked-up price, and the sales tax rate. The
program then outputs the original price of the item, the marked-up percentage of the item, the store’s selling price of the item, the sales tax rate,
the sales tax, and the final price of the item. (The final price of the item is
the selling price plus the sales tax.)
1
Expert's answer
2020-11-09T00:15:14-0500

import java.util.Scanner;


public class LocalStore {


public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

int priceOfItem = 0;

int percentageOfTheMrkedupPrice = 0;

int salesTaxRate = 0;

double sellingPrice = 0;

double finalPrice = 0;

System.out.println("Please insert original price of the sold item and prss Enter: ");

priceOfItem = scan.nextInt();

System.out.println("Please insert the percentage of the marked-up price: ");

percentageOfTheMrkedupPrice = scan.nextInt();

System.out.println("Please insert the sales tax rate: ");

salesTaxRate = scan.nextInt();

System.out.println("Original price: " + priceOfItem);

System.out.println("Percentage of the marked-up price: " + percentageOfTheMrkedupPrice + "%");

sellingPrice = priceOfItem + ((priceOfItem * percentageOfTheMrkedupPrice) / 100);

System.out.println("Selling price: " + sellingPrice);

System.out.println("Sales tax rate: " + salesTaxRate + "%");

finalPrice = sellingPrice - ((sellingPrice * salesTaxRate) / 100);

System.out.println("Final price: " + finalPrice);

scan.close();

}


}


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

Assignment Expert
16.11.20, 17:05

Dear visitor, please use panel for submitting new questions

Hamza saeed
16.11.20, 16:56

. Suppose that you have the following statements: String str; str = "Java programming: from problem analysis to program design"; What is the value of the following expressions? a. str.indexOf("analysis") b. str.substring(5, 16) c. str.startsWith("Java") d. str.startsWith("J") e. str.endsWith(".")

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS