Question: ACTIVITY 7 . 1 9 . 2 : Static fields and methods. 5 2 8 0 4 0 . 3 4 8 9 5 2

ACTIVITY
7.19.2: Static fields and methods.
528040.3489528.93zqy7
Jump to level 1
Create a public static method named resetNextCustomerldIfFull() that assigns the private static integer field nextCustomerld with 601 and outputs "Room is full. Customer ID is reset to 601 for the next room." followed by a newline if nextCustomerld is greater than 700. resetNextCustomerldIfFull() returns no value.
Ex: If the input is Mei Kai Pat, then the output is:
Mel is assigned ID 699.
Kai is assigned ID 700.
Room is full. Customer ID is reset to 601 for the next room.
Pat is assigned ID 601.
NewCustomers.java
public class Customer {
private static int nextCustomerId =699;
private string name;
private int id;
public Customer(String newName){
name = newName;
id = nextCustomerId;
++nextCustomerId;
System.out.println(name +" is assigned ID "+ id +".");
}
Y* Your code goes here */
}
 ACTIVITY 7.19.2: Static fields and methods. 528040.3489528.93zqy7 Jump to level 1

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!