Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions solutions/cpp/lasagna/1/lasagna.cpp
Original file line number Diff line number Diff line change
@@ -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;
}