#Cook Your Lasagna java help
8 messages · Page 1 of 1 (latest)
ok
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
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);
}
}
https://bit.ly/howto-ask
read this link so you can learn how to use codeblock properly and then edit the post you just made
i just forgot to make the method public, it works now
Note you can edit posts, too
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!