Repository navigation
Expand file tree
/
Copy pathChambre.java
More file actions
105 lines (82 loc) · 2.21 KB
/
Copy pathChambre.java
File metadata and controls
105 lines (82 loc) · 2.21 KB
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
97
98
99
100
101
102
103
104
105
public class Chambre {
private int numChambre;
private int nombrePersonne;
private int typeChambre;
private boolean repas ;
private boolean balcon ;
private boolean vuePiscine;
private double tarif;
//les getters et les setters
public int getNumChambre() {
return numChambre;
}
public void setNumChambre(int numChambre) {
this.numChambre = numChambre;
}
public int getNombrePersonne() {
return nombrePersonne;
}
public void setNombrePersonne(int nombrePersonne) {
this.nombrePersonne = nombrePersonne;
}
public int getTypeChambre() {
return typeChambre;
}
public void setTypeChambre(int typeChambre) {
this.typeChambre = typeChambre;
}
public boolean isRepas() {
return repas;
}
public void setRepas(boolean repas) {
this.repas = repas;
}
public boolean isBalcon() {
return balcon;
}
public void setBalcon(boolean balcon) {
this.balcon = balcon;
}
public boolean isVuePiscine() {
return vuePiscine;
}
public void setVuePiscine(boolean vuePiscine) {
this.vuePiscine = vuePiscine;
}
public double getTarif() {
return tarif;
}
public void setTarif(double tarif) {
this.tarif = tarif;
}
// constructeur par attributs :
public Chambre(int numChambre, int nombrePersonne, int typeChambre, boolean repas, boolean balcon,
boolean vuePiscine, double tarif) {
super();
this.numChambre = numChambre;
this.nombrePersonne = nombrePersonne;
this.typeChambre = typeChambre;
this.repas = repas;
this.balcon = balcon;
this.vuePiscine = vuePiscine;
this.tarif = tarif;
}
//constructeur par defaut
public Chambre() {
super();
// TODO Auto-generated constructor stub
}
//methode pour calculer tarif
/*Pour châque option choisi par le client
lord de la réservation augmente d'un certain pourcentage le tarif de base de la chambre*/
//J'ai choisis les valeurs des pourcentages au hasard et peuvent être modifiées par la suite
public double calculerTarif() {
if (repas == true)
tarif += ((tarif/100)*15);
if (balcon == true)
tarif += ((tarif/100)*30);
if (vuePiscine == true)
tarif += ((tarif/100)*15);
return tarif;
}
}