Westonci.ca is your go-to source for answers, with a community ready to provide accurate and timely information. Get quick and reliable solutions to your questions from knowledgeable professionals on our comprehensive Q&A platform. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.
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:
We hope our answers were useful. Return anytime for more information and answers to any other questions you have. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. We're here to help at Westonci.ca. Keep visiting for the best answers to your questions.