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();
}
}
Comments
Dear visitor, please use panel for submitting new questions
. 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