#[C++] Help with Lasagna Exercise

31 messages ยท Page 1 of 1 (latest)

pure jacinth
#

You can use one of the functions as a helper function for that part.

raw acorn
#

Do you understand how elapsed time works? What elapsedTime(3, 20) means and why it is 26?

lean fiber
#

not really

#

oh wait I think I do

#

number of layers * 2 makes it 6

#

actual minutes is 20

#

you add them

#

how do I use one of the functions as a helper function?

upper marsh
#

Do you know how to call a function?

lean fiber
#

yes

#

I thought that I didn't need to do that because exercism auto does it.

raw acorn
#

You don't need to call any functions.

#

If you go for a code review, a mentor may discuss that with you

#

But it's entirely unneeded to understand and solve this task

#

number of layers * 2 makes it 6
actual minutes is 20
you add them
That's exactly correct! Can you use that to solve this task?

upper marsh
#

Yeah you don't need to call any of the exercise functions, You just could do it.
As Isaac says tho you can discuss that with a mentor later on

raw acorn
#

We try to focus on passing the tests and solving the exercise here on Discord ๐Ÿ˜‰ Leave the optimizations and improvements to the mentor discussions.

lean fiber
#

I think what I might have done wrong is that I didn't set numberOfLayers = numberOfLayers * 2

#

is this wrong?

raw acorn
#

That would double the number of layers you have?

lean fiber
#

oh wait

raw acorn
#

You already typed out an algorithm to solve it ๐Ÿ˜‰

number of layers * 2 makes it 6
actual minutes is 20
you add them

#

Focus on implementing that

lean fiber
#

yeah

#

ok I solved it, but I'm not sure if I could do it in a more readable way.

#
    // TODO: Calculate and return the total time so far.
    return numberOfLayers * 2 + actualMinutesInOven;
}
idle mural
#

did you see any previous function that you created share any similarity with the code you just wrote?

lean fiber
#

preparationTime()

idle mural
#

maybe you can use that then

lean fiber
#

yay figured it out

#

thanks