Enter amount of sale: 10 // run 1 The tax is: $0.65 The total is: $10.65 Enter amount of sale: 12.5 // run 2 The tax is: $0.81 The total is: $13.31
Hints & Updates
System.out.printf("The tax is $ %.2f%n", variable_storing_the_tax_value);The two after the period tells the .printf method to format the output to exactly two decimal places, and the %n causes a newline.
use the NumberFormat.getCurrencyInstance() example discussed in class.