001-001-005
Variable Declaration: Recipe Card
Easy
Problem Description
Variable Declaration: Recipe Card
Learning Objective: Organize data using multiple variables and display in a visually clear format
Create a program that displays a neat recipe card when you enter recipe information. Store the dish name, cooking time, and number of ingredients in variables.
Input
Line 1: Dish name (string)
Line 2: Cooking time (integer, in minutes)
Line 3: Number of ingredients (integer)
Output
================================
Recipe Card
================================
Dish: [dish name]
Cooking Time: [time] minutes
Ingredients: [number] items
================================
```java
## Examples
### Example 1: Curry Rice Recipe
Input:
```java
Curry Rice
30
8
```java
Output:
```java
================================
Recipe Card
================================
Dish: Curry Rice
Cooking Time: 30 minutes
Ingredients: 8 items
================================
```java
### Example 2: Omelette Rice Recipe
Input:
```java
Omelette Rice
20
5
```java
Output:
```java
================================
Recipe Card
================================
Dish: Omelette Rice
Cooking Time: 20 minutes
Ingredients: 5 items
================================
```java
### Example 3: Water Recipe
Input:
```java
Water
1
1
```java
Output:
```java
================================
Recipe Card
================================
Dish: Water
Cooking Time: 1 minute
Ingredients: 1 item
================================
Test Cases
※ Output examples follow programming industry standards
Input:
Curry Rice 30 8
Expected Output:
================================
Recipe Card
================================
Dish: Curry Rice
Cooking Time: 30 minutes
Ingredients: 8 types
================================Input:
Omelette Rice 20 5
Expected Output:
================================
Recipe Card
================================
Dish: Omelette Rice
Cooking Time: 20 minutes
Ingredients: 5 types
================================Input:
Water 1 1
Expected Output:
================================
Recipe Card
================================
Dish: Water
Cooking Time: 1 minutes
Ingredients: 1 types
================================❌ 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 6 free executions remaining
