-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHotelManage.java
More file actions
40 lines (34 loc) · 949 Bytes
/
HotelManage.java
File metadata and controls
40 lines (34 loc) · 949 Bytes
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
package Inheritance;
import java.util.Scanner;
import java.util.Vector;
public class HotelManage {
Vector<Integer> vInt = new Vector<Integer>();
Vector<Room> vRoom = new Vector<Room>();
public HotelManage() {
InputRoom();
ViewRoom();
}
public void InputRoom() {
int n=2;// so room se nhap
for(int i=0;i<n;i++) {
Scanner key = new Scanner(System.in);
System.out.println("Num of beds=");
int beds = Integer.parseInt(key.nextLine());
System.out.println("Is tv");
boolean tv = key.nextBoolean();
System.out.println("Is tp");
boolean telephone = key.nextBoolean();
Room r = new Room(beds, tv, telephone);
vRoom.add(r);
}
}
public void ViewRoom() {
for(int i =0;i<vRoom.size();i++) {
System.out.println("Beds is"+vRoom.get(i).getBeds());
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new HotelManage();
}
}