-
Notifications
You must be signed in to change notification settings - Fork 0
/
Oefening_10.php
43 lines (41 loc) · 1.28 KB
/
Oefening_10.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
<?php
class Oefening {
public function getSom ($getal1, $getal2){
$som = ($getal1 + $getal2);
return $som;
}
public function getVerschil ($getal1, $getal2){
$som = ($getal1 - $getal2);
return $som;
}
public function getProduct ($getal1, $getal2){
$som = ($getal1 * $getal2);
return $som;
}
public function getquotient($getal1, $getal2){
$som = ($getal1 / $getal2);
return $som;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$uitkomst = new Oefening();
if ($_GET["bewerking"] == 1) {
print $uitkomst->getSom($_GET["getal1"], $_GET["getal2"]);
} elseif ($_GET["bewerking"] == 2) {
print $uitkomst->getVerschil($_GET["getal1"], $_GET["getal2"]);
} elseif ($_GET["bewerking"] == 3) {
print $uitkomst->getProduct($_GET["getal1"], $_GET["getal2"]);
} elseif ($_GET["bewerking"] == 4) {
print $uitkomst->getquotient ($_GET["getal1"], $_GET["getal2"]);
}
?>
</body>
</html>