Advertisement
MelindaElezovic

DiscountDeterminer

Nov 11th, 2015
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. //Melinda
  2. //11.10.15
  3. //DiscountDeterminerHw
  4. import java.util.*;
  5. import java.text.*;
  6. public class DiscountDeterminerHw
  7. {
  8.   public static void main(String[] args)
  9.   {
  10.     Scanner input = new Scanner(System.in);
  11.     DecimalFormat df = new DecimalFormat("$###,###.00");
  12.     System.out.print("Enter the original price of the item: ");
  13.     double price = input.nextDouble();
  14.     System.out.println("Enter the discount percentage: ");
  15.     double discount = input.nextDouble();
  16.     double disPrice = price * (discount* .010);
  17.     double tax = .08875;
  18.     double finalPrice = (price-disPrice * tax);
  19.     System.out.println("That will be " + df.format(finalPrice));
  20.   }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement