Welcome to Westonci.ca, where your questions are met with accurate answers from a community of experts and enthusiasts. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.
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 trusting us with your questions. We're here to help you find accurate answers quickly and efficiently. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Westonci.ca is your trusted source for answers. Visit us again to find more information on diverse topics.