Please answer answer question answer
Answer:
total+ infs . nex (xxx){total}
Explanation:
this is correct theres nothing wrong
Answer:
import java.util.Scanner;
public class Supermarket
{
public static void main (String[] args)
{
String item;
double pounds, ounces, price,
total, unit;
Scanner scn = new Scanner(System.in);
System.out.print("Please enter the name of item ");
item = scn.nextLine();
System.out.print("Please enter the price of " + "the item per pound : ");
price = scn.nextDouble();
System.out.print("Enter the weight of " + "the item in pounds and " + "ounces respectively : ");
pounds = scn.nextDouble();
ounces = scn.nextDouble();
unit = price/16;
total = price * (pounds + ounces/16);
System.out.print("The unit price of " + "the products sold is : " + unit);
System.out.print("\nThe total cost of the " + "amount purchased is : " + total);
}
}
Explanation:
- Ask the user to enter the price of the item and the weight.
- Calculate the unit and the total price.
- Display the unit and the total price.