fork download
  1. import java.util.Scanner;
  2.  
  3. class FixDebugTwo4
  4. {
  5. public static void main(String[] args)
  6. {
  7. double cost;
  8. final double TAX = 0.06;
  9. Scanner input = new Scanner(System.in);
  10. System.out.print("Enter cost of purchase >> ");
  11. cost = input.nextDouble();
  12. System.out.println("Cost is $" + cost);
  13. System.out.println("With " + (TAX * 100) + "% tax,");
  14. System.out.println(" the total is $" + (cost + cost * TAX));
  15. }
  16. }
Success #stdin #stdout 0.25s 60948KB
stdin
2
stdout
Enter cost of purchase >> Cost is $2.0
With 6.0% tax,
   the total is $2.12