From 6aead4e79b3c06473cee5df9c4b5a60c69a049ca Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 17:31:35 +0000 Subject: [PATCH] [Sync Iteration] cpp/lasagna/1 --- solutions/cpp/lasagna/1/lasagna.cpp | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 solutions/cpp/lasagna/1/lasagna.cpp 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; +}