{"id":16104924,"url":"https://github.com/dbc2201/lasagna","last_synced_at":"2026-06-23T12:02:19.509Z","repository":{"id":133011776,"uuid":"461842119","full_name":"dbc2201/lasagna","owner":"dbc2201","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-21T12:02:04.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T02:32:37.906Z","etag":null,"topics":["exercism-solutions","java"],"latest_commit_sha":null,"homepage":"https://exercism.org/tracks/java/exercises/lasagna","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbc2201.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-21T12:02:00.000Z","updated_at":"2022-02-21T12:02:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"f013efdc-9e5b-44f3-9543-a7d08ff8a718","html_url":"https://github.com/dbc2201/lasagna","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dbc2201/lasagna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Flasagna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Flasagna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Flasagna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Flasagna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbc2201","download_url":"https://codeload.github.com/dbc2201/lasagna/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbc2201%2Flasagna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34686728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exercism-solutions","java"],"created_at":"2024-10-09T19:07:04.352Z","updated_at":"2026-06-23T12:02:19.465Z","avatar_url":"https://github.com/dbc2201.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cook your lasagna\n\nWelcome to Cook your lasagna on Exercism's Java Track. If you need help running the tests or submitting your code, check\nout `HELP.md`. If you get stuck on the exercise, check out `HINTS.md`, but try and solve it without using those first :)\n\n## Introduction\n\nJava is a statically-typed language, which means that everything has a type at compile-time. Assigning a value to a name\nis referred to as defining a variable. A variable is defined by explicitly specifying its type.\n\n```java\nint explicitVar=10;\n```\n\nUpdating a variable's value is done through the `=` operator. Once defined, a variable's type can never change.\n\n```java\nint count=1; // Assign initial value\n        count=2;     // Update to new value\n\n// Compiler error when assigning different type\n// count = false;\n```\n\nJava is an [object-oriented language][object-oriented-programming] and requires all functions to be defined in a _class_\n. The `class` keyword is used to define a class.\n\n```java\nclass Calculator {\n    // ...\n}\n```\n\nA function within a class is referred to as a _method_. Each method can have zero or more parameters. All parameters\nmust be explicitly typed, there is no type inference for parameters. Similarly, the return type must also be made\nexplicit. Values are returned from functions using the `return` keyword. To allow a method to be called by other\nclasses, the `public` access modifier must be added.\n\n```java\nclass Calculator {\n    public int add(int x, int y) {\n        return x + y;\n    }\n}\n```\n\nInvoking a method is done by specifying its class and method name and passing arguments for each of the method's\nparameters.\n\n```java\nint sum=new Calculator().add(1,2);\n```\n\nScope in Java is defined between the `{` and `}` characters.\n\nJava supports two types of comments. Single line comments are preceded by `//` and multiline comments are inserted\nbetween `/*` and `*/`.\n\n[object-oriented-programming]: https://docs.oracle.com/javase/tutorial/java/javaOO/index.html\n\n## Instructions\n\nIn this exercise you're going to write some code to help you cook a brilliant lasagna from your favorite cooking book.\n\nYou have four tasks, all related to the time spent cooking the lasagna.\n\n## 1. Define the expected oven time in minutes\n\nDefine the `expectedMinutesInOven()` method that does not take any parameters and returns how many minutes the lasagna\nshould be in the oven. According to the cooking book, the expected oven time in minutes is 40:\n\n```java\nLasagna lasagna=new Lasagna();\n        lasagna.expectedMinutesInOven();\n// =\u003e 40\n```\n\n## 2. Calculate the remaining oven time in minutes\n\nDefine the `remainingMinutesInOven()` method that takes the actual minutes the lasagna has been in the oven as a\nparameter and returns how many minutes the lasagna still has to remain in the oven, based on the expected oven time in\nminutes from the previous task.\n\n```java\nLasagna lasagna=new Lasagna();\n        lasagna.remainingMinutesInOven(30);\n// =\u003e 10\n```\n\n## 3. Calculate the preparation time in minutes\n\nDefine the `preparationTimeInMinutes()` method that takes the number of layers you added to the lasagna as a parameter\nand returns how many minutes you spent preparing the lasagna, assuming each layer takes you 2 minutes to prepare.\n\n```java\nLasagna lasagna=new Lasagna();\n        lasagna.preparationTimeInMinutes(2);\n// =\u003e 4\n```\n\n## 4. Calculate the total working time in minutes\n\nDefine the `totalTimeInMinutes()` method that takes two parameters: the first parameter is the number of layers you\nadded to the lasagna, and the second parameter is the number of minutes the lasagna has been in the oven. The function\nshould return how many minutes in total you've worked on cooking the lasagna, which is the sum of the preparation time\nin minutes, and the time in minutes the lasagna has spent in the oven at the moment.\n\n```java\nLasagna lasagna=new Lasagna();\n        lasagna.totalTimeInMinutes(3,20);\n// =\u003e 26\n```\n\n## Source\n\n### Created by\n\n- @mirkoperillo","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbc2201%2Flasagna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbc2201%2Flasagna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbc2201%2Flasagna/lists"}