mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-11-09 13:20:48 -05:00
22 lines
742 B
C++
22 lines
742 B
C++
|
// ovenTime returns the amount in minutes that the lasagna should stay in the
|
||
|
// oven.
|
||
|
int ovenTime() { return 40; }
|
||
|
|
||
|
/* remainingOvenTime returns the remaining
|
||
|
minutes based on the actual minutes already in the oven.
|
||
|
*/
|
||
|
int remainingOvenTime(int actualMinutesInOven) {
|
||
|
return ovenTime() - actualMinutesInOven;
|
||
|
}
|
||
|
|
||
|
/* preparationTime returns an estimate of the preparation time based on the
|
||
|
number of layers and the necessary time per layer.
|
||
|
*/
|
||
|
int preparationTime(int numberOfLayers) { return numberOfLayers * 2; }
|
||
|
|
||
|
// elapsedTime calculates the total time spent to create and bake the lasagna so
|
||
|
// far.
|
||
|
int elapsedTime(int numberOfLayers, int actualMinutesInOven) {
|
||
|
return preparationTime(numberOfLayers) + actualMinutesInOven;
|
||
|
}
|