#Cook Your Lasagna java help

8 messages · Page 1 of 1 (latest)

fathom mirage
#

please use codeblock, picture is really hard to read, copy and edit

tiny jolt
#

ok

fathom mirage
#

Increase your chance of getting help and look like a pro by sharing codeblocks not images. For example, you can type the following. Note, the ``` must be on their own line.

for number in range(10):
    total += number;

Discord will render that as so:
for number in range(10):
total += number;

Click here to learn more about codeblocks, including how to indicate the programming language: https://exercism.org/docs/community/being-a-good-community-member/writing-support-requests and http://bit.ly/howto-ask

Exercism

Want help? Help yourself by learning how to write a good support request!

Do you often get ignored when you ask people online to help you with your coding problems? Make sure you're not breaking any of those 7 rules.

tiny jolt
#

class Calculator{
int sum(int numero1, int numero2){
return numero1 + numero2;
}
int sub(int numero1, int numero2){
return numero1 - numero2;
}
int mult(int numero1, int numero2){
return numero1 * numero2;
}
int div(int numero1, int numero2){
return numero1 / numero2;
}
}

public class Lasagna {
Calculator calculator = new Calculator();

 int expectedMinutesInOven(){
    return 40;
};

 int remainingMinutesInOven(int minutesInOven){
   return calculator.sub(expectedMinutesInOven(), minutesInOven);
}

 int preparationTimeInMinutes(int layerAdd){
    return calculator.mult(layerAdd, 2);
}

 int totalTimeInMinutes(int lasagnaLayers, int time){
    return preparationTimeInMinutes(lasagnaLayers) + time;
}
public static void main(String[] args) {
    Lasagna lasagna = new Lasagna();
    lasagna.expectedMinutesInOven();
    lasagna.remainingMinutesInOven(30);
    lasagna.preparationTimeInMinutes(2);
    lasagna.totalTimeInMinutes(3, 20);
}

}

fathom mirage
tiny jolt
#

i just forgot to make the method public, it works now

remote ice
#

Note you can edit posts, too

worldly ginkgoBOT
#

If everything is resolved, we ask that the person who posted the request react to the top/original post with a :white_check_mark: (:white_check_mark:). This indicates to others that this issue has been resolved and locks the thread.
If all the tests pass and you want to further improve your solution, we encourage you to use the "Request a Code Review" feature on the website!