I don´t understand why the tests find an error in my code:
// ovenTime returns the amount in minutes that the lasagna should stay in the
// oven.
int ovenTime() {
// TODO: Return the correct time.
return 40;
}
/* remainingOvenTime returns the remaining
minutes based on the actual minutes already in the oven.
*/
int timeSpendInOven = 0;
int neededBakeTime = 40;
int remainingOvenTime(int actualMinutesInOven) {
// TODO: Calculate and return the remaining in the oven based on the time
// the lasagna has already been there.
int actual = neededBakeTime - timeSpendInOven;
return actual;
}
/* preparationTime returns an estimate of the preparation time based on the
number of layers and the necessary time per layer.
*/
int ovenTimeForEachLayer = 2;
int preparationTime(int numberOfLayers) {
// TODO: Calculate and return the preparation time with the
// numberOfLayers.
int time = ovenTimeForEachLayer * numberOfLayers;
return time;
}
// elapsedTime calculates the total time spent to create and bake the lasagna so
// far.
int elapsedTime(int numberOfLayers, int actualMinutesInOven) {
// TODO: Calculate and return the total time so far.
return preparationTime(numberOfLayers) + actualMinutesInOven;
}