-
Notifications
You must be signed in to change notification settings - Fork 0
/
Caneta.php
81 lines (73 loc) · 2.07 KB
/
Caneta.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
70
71
72
73
74
75
76
77
78
79
80
81
<?php
class Caneta{
public string $modelo;
public float $ponta;
public string $cor;
public $tampado;
public int $carga;
public function __construct(){
$this->setTampado(true);
$this->setModelo("BIC CRISTALINA");
$this->setPonta(0.6);
$this->setCor("Rosa");
$this->setCarga(100);
}
public function tampar(){
$this->setTampado(true);
}
public function destampar(){
$this->setTampado(false);
}
public function modelo($m){
$this->setModelo($m);
}
public function ponta($p){
$this->setPonta($p);
}
public function cor($c){
$this->setCor($c);
}
public function carga($ca){
$this->setCarga($ca);
}
public function status(){
echo '----------------------------------<br>';
echo 'Tampada: '.($this->getTampado()?"SIM":"NÃO").'<br>';
echo 'Caneta de modelo: '.$this->getModelo().'<br>';
echo 'Ponta: '.$this->getPonta().'<br>';
echo 'Cor: '.$this->getCor().'<br>';
echo 'Carga: '.$this->getCarga()."%.<br>";
}
/* getters e setters */
public function getModelo(){
return $this->modelo;
}
public function setModelo($m){
$this->modelo = $m;
}
public function getPonta(){
return $this->ponta;
}
public function setPonta($p){
$this->ponta = $p;
}
public function getCor(){
return $this->cor;
}
public function setCor($c){
$this->cor = $c;
}
public function getTampado(){
return $this->tampado;
}
public function setTampado($t){
$this->tampado = $t;
}
public function getCarga(){
return $this->carga;
}
public function setCarga($ca){
$this->carga = $ca;
}
}
?>