Answered step by step
Verified Expert Solution
Link Copied!

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
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 */
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions