Get reliable answers to your questions at Westonci.ca, where our knowledgeable community is always ready to help. Discover reliable solutions to your questions from a wide network of experts on our comprehensive Q&A platform. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A 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:
Thanks for using our service. We're always here to provide accurate and up-to-date answers to all your queries. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.