-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guest.java
44 lines (39 loc) · 1.02 KB
/
Guest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* The Guest class is a class representing a Guest willing to book into a hotel
*/
public class Guest {
/** The first name of the guest. */
private String firstName;
/** The last name of the guest. */
private String lastName;
/**
* Constructor that creates a Guest.
* @param firstName First name of the Guest.
* @param lastName Last name of the Guest.
*/
public Guest(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
/**
* Gets the first name of the Guest.
* @return Guest's first name.
*/
public String getFirstName() {
return this.firstName;
}
/**
* Gets the last name of the Guest.
* @return Guest's last name.
*/
public String getLastName() {
return this.lastName;
}
/**
* Gets the full name of the Guest, including first and last names combines as a String.
* @return Guest's full name.
*/
public String getName() {
return this.firstName + " " + this.lastName;
}
}