/
Oefening_8-6.php
80 lines (68 loc) · 2.22 KB
/
Oefening_8-6.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
<?php
abstract class Rekening {
private $rekeningNr ;
private $saldo = 0;
private $omschrijving;
public function getSaldo() {
return $this->saldo;
}
public function Stort($bedrag){
$this->saldo = $this->saldo+$bedrag ;
}
public function setRekeningNr($rekeningNr){
$this->rekeningNr = $rekeningNr;
}
public function VoerIntrestDoor() {
}
}
class Spaarrekening extends Rekening{
private static $intrest = 0.03;
public function __contruct ($rekeningNr, $omschrijving) {
parent::setRekeningNr($rekeningNr);
}
public function getOmschriving(){
return ("Kortetermijnrekening");
}
public function VoerIntrestDoor(){
parent::stort (parent::getSaldo() * self::$intrest);
}
}
class Zichtrekening extends Rekening{
private static $intrest = 0.025;
public function __contruct ($rekeningNr) {
parent::setRekeningNr($rekeningNr);
}
public function getOmschriving(){
return ("Langetermijnrekening");
}
public function VoerIntrestDoor(){
parent::stort (parent::getSaldo() * self::$intrest);
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset=utf-8>
<title>Rekeningnummers</title>
</head>
<body>
<h1>
<?php $rek = new Zichtrekening("091-0122401-16");
print ($rek->getOmschriving() . "<br />");
print("Het saldo is: " .$rek->getSaldo() . "<br />");
$rek->stort(200);
print("Het saldo is: " .$rek->getSaldo() . "<br />");
$rek->voerIntrestDoor();
print("Het saldo is: " .$rek->getSaldo() . "<br />");
$rek = new Spaarrekening("091-0122401-16");
print ($rek->getOmschriving() . "<br />");
print("Het saldo is: " .$rek->getSaldo() . "<br />");
$rek->stort(100);
print("Het saldo is: " .$rek->getSaldo() . "<br />");
$rek->voerIntrestDoor();
print("Het saldo is: " .$rek->getSaldo() . "<br />");
?>
</h1>
</body>
</html>