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
Field Definition
- dishName: Name of the dish (String)
- ingredientCount: Number of ingredients (int)
- cookingTime: Cooking time in minutes (int)
Constructor
- Accept 3 arguments (dishName, ingredientCount, cookingTime)
- Initialize all fields
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
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
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
