diff --git a/solutions/cpp/lasagna/1/lasagna.cpp b/solutions/cpp/lasagna/1/lasagna.cpp new file mode 100644 index 0000000..75b1b19 --- /dev/null +++ b/solutions/cpp/lasagna/1/lasagna.cpp @@ -0,0 +1,34 @@ +// 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 remainingOvenTime(int actualMinutesInOven) { + // TODO: Calculate and return the remaining in the oven based on the time + // the lasagna has already been there. + int result = ovenTime() - actualMinutesInOven; + return result; +} + +/* preparationTime returns an estimate of the preparation time based on the + number of layers and the necessary time per layer. +*/ +int preparationTime(int numberOfLayers) { + // TODO: Calculate and return the preparation time with the + // `numberOfLayers`. + return 2 * numberOfLayers; +} + +// 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. + int cookLayers = preparationTime(numberOfLayers); + int result = cookLayers + actualMinutesInOven; + return result; +}