-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lucian's_Luscious_Lasagna.php
36 lines (28 loc) · 1.01 KB
/
Lucian's_Luscious_Lasagna.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
// Instructions
// In this exercise you're going to write some code to help you cook a brilliant lasagna from your favorite cooking book.
// You have five tasks, all related to the time spent cooking the lasagna.
//# 1. Define the expected oven time in minutes
//# 2. Calculate the remaining oven time in minutes
//# 3. Calculate the preparation time in minutes
//# 4. Calculate the total working time in minutes
//# 5. Create a notification that the lasagna is ready
<?php
declare(strict_types=1);
class Lasagna
{
public function expectedCookTime() {
return 40;
}
public function remainingCookTime($elapsed_minutes) {
return $this->expectedCookTime() - $elapsed_minutes;
}
public function totalPreparationTime($layers_to_prep) {
return $layers_to_prep * 2;
}
public function totalElapsedTime($layers_to_prep, $elapsed_minutes) {
return $this->totalPreparationTime($layers_to_prep) + $elapsed_minutes;
}
public function alarm() {
return "Ding!";
}
}