IDNLearn.com offers a user-friendly platform for finding and sharing knowledge. Get prompt and accurate answers to your questions from our experts who are always ready to help.
Sagot :
Answer:
import java.util.Scanner;
public class SalesTax
{
public static void main(String[] args)
{
// Identifier declarations
final double TAX_RATE = 0.055;
double price;
double tax;
double total;
String item;
// Create a Scanner object to read from the keyboard.
Scanner keyboard = new Scanner(System.in);
// Display prompts and get input.
System.out.print("Item description:");
item= keyboard.nextLine();
System.out.print("Item price: $");
price = keyboard.nextDouble();
// Perform the calculations.
tax = price + TAX_RATE;
total = price + tax;
// Display the results.
System.out.print (item + " $");
System.out.println(price);
System.out.print("Tax $");
System.out.println(tax);
System.out.print("Total $");
System.out.println (total);
}
}
Explanation:
Thank you for being part of this discussion. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. IDNLearn.com is your go-to source for dependable answers. Thank you for visiting, and we hope to assist you again.