Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ACTIVITY 7 . 1 9 . 2 : Static fields and methods. 5 2 8 0 4 0 . 3 4 8 9 5 2
ACTIVITY
: Static fields and methods.
Jump to level
Create a public static method named resetNextCustomerldIfFull that assigns the private static integer field nextCustomerld with and outputs "Room is full. Customer ID is reset to for the next room." followed by a newline if nextCustomerld is greater than resetNextCustomerldIfFull returns no value.
Ex: If the input is Mei Kai Pat, then the output is:
Mel is assigned ID
Kai is assigned ID
Room is full. Customer ID is reset to for the next room.
Pat is assigned ID
NewCustomers.java
public class Customer
private static int nextCustomerId ;
private string name;
private int id;
public CustomerString newName
name newName;
id nextCustomerId;
nextCustomerId;
System.out.printlnname is assigned ID id ;
Y Your code goes here
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