I am writing a Hotel Booking Application.
On the sheet I have it says.
"If a room is not booked, the customer is null"
I guess I have to write an if statement somewhere to check if the room has been booked or not and then set the customer to null?
Does anyone know where I would write this code in here? I have wrote the classes like specified in this UML Diagram.
Here is the code I have for Room which I am guessing is where this if statement would be? Can anyone help me out?
On the sheet I have it says.
"If a room is not booked, the customer is null"
I guess I have to write an if statement somewhere to check if the room has been booked or not and then set the customer to null?
Does anyone know where I would write this code in here? I have wrote the classes like specified in this UML Diagram.

Here is the code I have for Room which I am guessing is where this if statement would be? Can anyone help me out?
Code:
import javax.swing.*;
public class Room
{
int roomNumber;
int n = roomNumber;
double rate;
double t = rate;
String customer;
Room()
{
}
Room(int n, double t)
{
if( n >= 201 && roomNumber <= 203)
{
t = 35;
customer = null;
}
else
{
System.out.println("Please enter a correct room number");
}
}
void bookRoom(String customer)
{
}
void clearBooking()
{
}
String getCustomer()
{
return customer;
}
double getRate()
{
return rate;
}
int getRoomNumber()
{
return roomNumber;
}
public String toString()
{
return customer;
}
}