Untitled
unknown
java
2 years ago
1.2 kB
7
Indexable
Never
import java.util.*; public class BASIC_P102_14; { public static void main(String[] args) { String Price; String MarkedUp; String SalesTaxRate; Double SellingPrice; Double SalesTax; Double FinalPrice; Scanner in = new Scanner(System.in); System.out.println("Enter the original price of the item sold: "); Price = in.nextLine(); System.out.println("Enter the percentage of the marked-up price (in percent(%)): "); MarkedUp = in.nextLine(); System.out.println("Enter the sales tax rate (in percent(%)): "); SalesTaxRate = in.nextLine(); System.out.println("The original price of the item is " + Price); System.out.println("The marked-up percentage of the item is " + MarkedUp + "%"); SellingPrice = (Double.parseDouble(Price) + (Double.parseDouble(Price)) * (Double.parseDouble(MarkedUp)/100)); System.out.println("The store\'s selling price of the item is " + SellingPrice); System.out.println("The sales tax rate is " + SalesTaxRate + "%"); SalesTax = (((Double.parseDouble(Price)) * ((Double.parseDouble(SalesTaxRate)/100)))); System.out.printf("The sales tax is %.2f %n", SalesTax); FinalPrice = (SellingPrice + SalesTax); System.out.println("The final price of the item is %.2f %n", FinalPrice); } }