018-001-005

Recipe Manager: Managing Multiple Information with Classes

Medium

Problem Description

[Problem Description]

You are developing a recipe management application. Create a Recipe class to manage recipe information.

Requirements

  1. Field Definition

    • dishName: Name of the dish (String)
    • ingredientCount: Number of ingredients (int)
    • cookingTime: Cooking time in minutes (int)
  2. Constructor

    • Accept 3 arguments (dishName, ingredientCount, cookingTime)
    • Initialize all fields
  3. Information Display Method

    • Implement showRecipe() method
    • Output in the following format:
    Dish: [dish name]
    Ingredients: [ingredient count]
    Time: [cooking time] minutes
    ```java
    

Learning Points

  • Classes are tools to represent real-world objects
  • Fields can hold mixed data types
  • Methods access field data to perform processing.

Test Cases

※ Output examples follow programming industry standards

Input:
Expected Output:
Input:
Expected Output:
Input:
Expected Output:
Input:
Expected Output:
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 9 free executions remaining