-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path25-Concesionario.php
69 lines (42 loc) · 1.08 KB
/
25-Concesionario.php
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
<?php
//para una variable statica la llamamos atraves del operador self::
class Compra_vehiculo{
private $precio_base;
private static $ayuda=4500;//private impide modificar desde fuera
}
function Compra_vehiculo($gama){
if($gama =="urbano"){
$this->precio_base=10000;
}else if ($gama=="compacto"){
$this->precio_base=20000;
}else if ($gama=="berlina"){
$this->precio_base=40000;
}
}//fin del constructor
static function descuento_ayuda(){//ejemplo haciendolo atraves de funcion
if(date("m-d-y")> "05-01-23"){//formato fecha
self::$ayuda=4500;
}
function climatizador(){
$this->precio_base += 2000;
}
function navegador_gps(){
$this->precio_base+=2500;
}
function tapiceria_cuero($Color){
if($color=="blanco"){
$this->precio_base+=3000;
}
else if($color=="beige"){
$this->precio_base +=3500;
else{
$this->precio_base+=5000;
}
}
function precio_final(){
$valor_final=$this->precio_base-self::$ayuda;
return $this->precio_base;
}
}
}
?>