Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.text.*;
- public class DiscountDeterminer{
- public static void main (String []args){
- Scanner input = new Scanner(System.in);
- System.out.println("Could you give me the price of the discounted item?");
- double price = input.nextDouble();
- System.out.println("How much discount is there?");
- double percent = input.nextDouble();
- double npercent = (100-percent)* 0.01;
- double nc = price * (npercent);
- double ncwt = nc * 1.08875;
- DecimalFormat dfA = new DecimalFormat("$###.00");
- System.out.println("The new price of the discounted item is " + dfA.format(nc) + ".");
- System.out.println("The price with tax is " + dfA.format(ncwt) + ".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement