Question: Create a public static method named resetNextTicketIfFull ( ) that assigns the private static integer field nextTicket with 1 and outputs Line is full. Order

Create a public static method named resetNextTicketIfFull() that assigns the private static integer field nextTicket with 1 and outputs "Line is full. Order ticket is reset to 1 for the next line." followed by a newline if nextTicket is greater than 100. resetNextTicketIfFull() returns no value.
Ex: If the input is butter cheese oatmeal, then the output is:
ticket 99 is butter.
ticket 100 is cheese.
Line is full. Order ticket is reset to 1 for the next line.
ticket 1 is oatmeal.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!