Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Name: James Inglis
- * Syntax: Java
- * Date: 7/8/14
- * Description: This program takes in the price for an item,
- * the markup percentage, and sales tax. Then, computes
- * to find the total price for the item.
- */
- import java.util.*;
- public class Num12
- {
- static Scanner console = new Scanner(System.in);
- static final double SALES_TAX = 6.25; // Tax Percentage.
- public static void main(String[] args)
- {
- double readPrice,taxPrice, totalPrice, markUpPer;
- int markUp;
- // Getting the item price.
- System.out.print("Enter in the price of the item: ");
- readPrice = console.nextDouble();
- System.out.println();
- // Getting the markup.
- System.out.print("Enter in the markup percentage: ");
- markUp = console.nextInt();
- System.out.println();
- // Converting markup percentage and sales tax. Then, adding to sales item.
- markUpPer = ((double)(markUp) / 100) * readPrice;
- taxPrice = readPrice / SALES_TAX;
- totalPrice = markUpPer + taxPrice + readPrice;
- // Displaying the total price of item.
- System.out.printf("The total price for the item is: $%.2f",totalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement