Final answer:
Here is a sample program code that asks the user for their pizza order and displays it.
Step-by-step explanation:
Here is a sample program code that asks the user for their pizza order and displays it:
import java.util.Scanner;
public class PizzaOrder {
public static void main(String[] args) {
// Create a Scanner object
Scanner input = new Scanner(System.in);
// Ask the user for their pizza order
System.out.print("What size pizza (small, medium, or large)? ");
String size = input.nextLine();
System.out.print("What type of crust? ");
String crust = input.nextLine();
System.out.print("What kind of cheese? ");
String cheese = input.nextLine();
System.out.print("What topping? ");
String topping = input.nextLine();
// Print the user's pizza order
System.out.println("Your pizza order:");
System.out.println("Size: " + size);
System.out.println("Crust: " + crust);
System.out.println("Cheese: " + cheese);
System.out.println("Topping: " + topping);
}
}