#Lasagna Receipt JS
55 messages · Page 1 of 1 (latest)
so, what would need to be the final function?
Given the number of minutes ahead in the oven, return the remaining minutes in the oven
I can't understand the code, i tried but can't get it. My last try was this code
return actualMinutesInOven;
}```
The total time should be 40 minutes. If the lasagna was already in the oven for 30 minutes, then there are 10 minutes remaining.
Are you having trouble understanding code or the instructions?
code
What code? You're supposed to write your own code which implements the requirements.
i don't know what i'm suposed to write
Do you understand the requirements? What should the code look like to implement those requirements?
Can you write instructions in English that implements the requirements?
It's not very helpful to write code before understanding what the code is supposed to be doing
Please use codeblocks to share text. Images are hard to read.
i wrote the const = 40, all the other code is the exercise, could you tell me how to proceed?
You're supposed to write instructions which, given the actualMinutesInOven will return the remainingMinutesInOven. How would you figure that out, using English to write the instructions?
" @torpid hazel , I know how long my lasagna was in the oven. I need to know how many minutes remain. How do I figure that out?"
Imagine your mom asked you that. How do you respond?
yeah, its been 20 minutes in the oven, so there remain 20 more
You don't know how many minutes it's been, but your mom does. How can she figure out how much time remains?
due to the time required - the actual time
So if it's been in the oven for 5 minutes (actual time), then 5 minutes remain?
35 minutes remain
How do I figure that out, though?
40-5=35
What steps do I take?
Give me instructions
You need to write steps, not an answer. Your mom wants to know how to figure out how much time is left without telling you how long it's been in the oven.
to know the time left substract the actual time to the remaining time
Subtract what from what? I have the actual time. What do I do with it?
A - B = C
What are A, B, C?
receipt time - actual time = remaining
What is receipt time?
So ... 40 - actual = remaining?
yes
Can you write code that does that?
I think 40 is a number
40 - actual = remaining
Or so you told me a minute ago
Let's assume that's correct for now. Given that 40 - actual = remaining, can you write code that uses actualMinutesInOven to get the remaining time.
export function remainingMinutesInOven(actualMinutesInOven) {
throw new Error(remainingMinutesInOven = 40 - actualMinutesInOven);
}```
idk how to say to you i don't understand what i'm writting
You got the equation in there. That's better. Do you want to throw an error?
Maybe you should read an intro to programming first
maybe, you have that?