Lucian's girlfriend is on her way home, and he hasn't cooked their anniversary dinner!
In this exercise, you're going to write some code to help Lucian cook an exquisite lasagna from his favorite cookbook.
You have four tasks related to the time spent cooking the lasagna.
Define the expected_minutes_in_oven constant that represents how many minutes the lasagna should be in the oven. According to the cooking book, the expected oven time in minutes is 40.
Implement the remaining_minutes_in_oven method that takes the actual minutes the lasagna has been in the oven as a parameter and returns how many minutes the lasagna still has to remain in the oven, based on the expected oven time in minutes from the previous task.
remaining_minutes_in_oven( 30 ).
// => 10Implement the preparation_time_in_minutes method that takes the number of layers you added to the lasagna as a parameter and returns how many minutes you spent preparing the lasagna, assuming each layer takes you 2 minutes to prepare.
preparation_time_in_minutes( 2 ).
// => 4Implement the total_time_in_minutes method that takes two parameters: the numbernumber_of_layers parameter is the number of layers you added to the lasagna, and the actual_minutes_in_oven parameter is the number of minutes the lasagna has been in the oven. The method should return how many minutes in total you've worked on cooking the lasagna, which is the sum of the preparation time in minutes, and the time in minutes the lasagna has spent in the oven at the moment.
total_time_in_minutes(
numbernumber_of_layers = 3
actual_minutes_in_oven = 20 ).
// => 26Lucian's girlfriend is on her way home, and he hasn't cooked their anniversary dinner!
In this exercise, you're going to write some code to help Lucian cook an exquisite lasagna from his favorite cookbook.
You have four tasks related to the time spent cooking the lasagna.
Define the expected_minutes_in_oven constant that represents how many minutes the lasagna should be in the oven. According to the cooking book, the expected oven time in minutes is 40.
Implement the remaining_minutes_in_oven method that takes the actual minutes the lasagna has been in the oven as a parameter and returns how many minutes the lasagna still has to remain in the oven, based on the expected oven time in minutes from the previous task.
remaining_minutes_in_oven( 30 ).
// => 10Implement the preparation_time_in_minutes method that takes the number of layers you added to the lasagna as a parameter and returns how many minutes you spent preparing the lasagna, assuming each layer takes you 2 minutes to prepare.
preparation_time_in_minutes( 2 ).
// => 4Implement the total_time_in_minutes method that takes two parameters: the numbernumber_of_layers parameter is the number of layers you added to the lasagna, and the actual_minutes_in_oven parameter is the number of minutes the lasagna has been in the oven. The method should return how many minutes in total you've worked on cooking the lasagna, which is the sum of the preparation time in minutes, and the time in minutes the lasagna has spent in the oven at the moment.
total_time_in_minutes(
numbernumber_of_layers = 3
actual_minutes_in_oven = 20 ).
// => 26