Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a public static integer field named nextTicket and initialize nextTicket with 4 0 0 public class Order { private String food; private int ticket;
Create a public static integer field named nextTicket and initialize nextTicket with public class Order
private String food;
private int ticket;
public OrderString newFood
food newFood;
ticket nextTicket;
nextTicket ;
public void print
System.out.printlnfood s ticket is ticket ;
import java.util.Scanner;
public class NewOrders
public static void mainString args
Scanner scnr new ScannerSystemin;
System.out.printlnNext available ticket is Order.nextTicket ;
Order order new Orderscnrnext;
Order order new Orderscnrnext;
Order order new Orderscnrnext;
orderprint;
orderprint;
orderprint;
System.out.printlnNext available ticket is Order.nextTicket ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started