-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathExtension.java
More file actions
65 lines (41 loc) · 1.59 KB
/
Extension.java
File metadata and controls
65 lines (41 loc) · 1.59 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
package com.booleanuk.extension;
import com.booleanuk.helpers.ExtensionBase;
public class Extension extends ExtensionBase {
// Let's make a cake!
/*
5. Create a method named bakingTime that returns the number 50
*/
public int bakingTime(){
return 50;
}
/*
6. Create a method named remainingBakeTime that accepts one input:
- the number of minutes the cake has been in the oven
It must return how many minutes are left to bake based on the input
and the result of calling the bakingTime method
*/
public int remainingBakeTime(int done) {
int number = bakingTime() - done;
return number;
}
/*
7. Create a method named calculatePrepTime that accepts one input:
- the number of layers the cake has
It must return how many minutes it will take to prepare the cake based on
each layer taking 3 minutes to prepare
*/
public int calculatePrepTime(int layers){
return layers * 3;
}
/*
8. Create a method named totalTimeSpent that accepts two inputs in this order:
- the number of layers the cake has
- the number of minutes the cake has already been in the oven
It must return how many minutes in total you have spent making the cake,
which is the sum of the preparation time and the number of minutes it's been
in the oven. Use your calculatePrepTime method in the calculation
*/
public int totalTimeSpent(int layers, int minutes){
return calculatePrepTime(layers) + minutes;
}
}