-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinit.php
More file actions
71 lines (49 loc) · 1.33 KB
/
init.php
File metadata and controls
71 lines (49 loc) · 1.33 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
<?php
require_once 'AbstractVehicle.php';
require_once 'MotorcycleClass.php';
require_once 'HelmetClass.php';
try {
$motorCycleDucati = new MotorcycleClass();
$motorCycleDucati -> setName('Ducati');
$motorCycleDucati -> setFuelUsage(4);
$motorCycleDucati -> setFuelRemaining(20);
$helmet = new HelmetCLass();
$helmet->setType('shortDistance');
$motorCycleDucati -> setHelmet($helmet);
$motorCycleDucati->setHelmetStatus(true);
$motorCycleDucati -> run(300);
var_dump($motorCycleDucati);
} catch(Exception $e) {
echo '<h2>İstisnalar</h2>';
echo $e -> getMessage() . '<br>';
} catch (Error $e) {
echo '<h2>Hatalar</h2>';
echo $e -> getMessage();
}finally{
echo '<h2>Son olarak...</h2>';
if($motorCycleDucati->getStatus()==true)
$motorCycleDucati->stop();
}
die();
require_once 'AbstractVehicle.php';
require_once 'CarClass.php';
try {
$carAudi = new CarClass();
$carAudi -> setName('Audi A4');
$carAudi -> setFuelUsage(6.4);
$carAudi -> setFuelRemaining(20);
$carAudi -> setSafetyBeltStatus(true);
$carAudi -> run(200);
var_dump($carAudi);
} catch(Exception $e) {
echo '<h2>İstisnalar</h2>';
echo $e -> getMessage() . '<br>';
} catch (Error $e) {
echo '<h2>Hatalar</h2>';
echo $e -> getMessage();
}finally{
echo '<h2>Son olarak...</h2>';
if($carAudi->getStatus()==true)
$carAudi->stop();
}
die();