-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReservations.java
96 lines (77 loc) · 2.76 KB
/
Reservations.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author Mariam
*/
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Random;
public class Reservations {
private LocalDate checkInDate; //
private LocalDate checkOutDate;//
private String customerName;
private long customerID;
private long reservationID;
private Rooms reservedRoom;
// --> cash , visa -->handle visa inputs
public Reservations() {
}
public Reservations(LocalDate checkInDate, LocalDate checkOutDate, String customerName, long customerID, Rooms reservedRoom) {
this.checkInDate = checkInDate;
this.checkOutDate = checkOutDate;
this.customerName = customerName;
this.customerID = customerID;
this.reservedRoom = reservedRoom;
}
public LocalDate getCheckInDate() {
return checkInDate;
}
public void setCheckInDate(LocalDate checkInDate) {
this.checkInDate = checkInDate;
}
public LocalDate getCheckOutDate() {
return checkOutDate;
}
public void setCheckOutDate(LocalDate checkOutDate) {
this.checkOutDate = checkOutDate;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public long getCustomerID() {
return customerID;
}
public void setCustomerID(long customerID) {
this.customerID = customerID;
}
public Rooms getReservedRoom() {
return reservedRoom;
}
public void setReservedRoom(Rooms reservedRoom) {
this.reservedRoom = reservedRoom;
}
private long getReservationID() {
Random random = new Random();
this.reservationID = random.nextInt(90000) + 10000;
return reservationID;
}
// print reservation details
public void printReservationInfo() {
System.out.println("****************************************");
System.out.println("Reservation details : ");
System.out.println("Customer name : " + getCustomerName());
System.out.println("Customer ID : " + getCustomerID());
System.out.println("Check-in date : " + getCheckInDate());
System.out.println("Check-out date : " + getCheckOutDate());
System.out.println("Room details : ");
reservedRoom.printRoomDetails();
System.out.println("Reservation ID : " + getReservationID());
System.out.println("****************************************");
}
}