From 0a661335d96550408b11d6042feb91b803f10751 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 15:42:24 +0000 Subject: [PATCH] [Sync Iteration] cpp/lasagna/1 --- solutions/cpp/lasagna/1/lasagna.cpp | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 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..ff256c2 --- /dev/null +++ b/solutions/cpp/lasagna/1/lasagna.cpp @@ -0,0 +1,30 @@ +// ovenTime returns the amount in minutes that the lasagna should stay in the +// oven. +int ovenTime() { + unsigned int time = 40; + + return time; +} + +/* remainingOvenTime returns the remaining + minutes based on the actual minutes already in the oven. +*/ +int remainingOvenTime(int actualMinutesInOven) { + unsigned int remainingTime = ovenTime() - actualMinutesInOven; + return remainingTime; +} + +/* preparationTime returns an estimate of the preparation time based on the + number of layers and the necessary time per layer. +*/ +int preparationTime(int numberOfLayers) { + unsigned int layerTime = numberOfLayers * 2; + return layerTime; +} + +// elapsedTime calculates the total time spent to create and bake the lasagna so +// far. +int elapsedTime(int numberOfLayers, int actualMinutesInOven) { + unsigned int timeElapsed = preparationTime(numberOfLayers) + actualMinutesInOven; + return timeElapsed; +}