004-006-006
Array Copy: Recipe Ingredients List
Easy
Problem Description
Array Copy: Recipe Ingredients List
Learning Objective: Copy string array elements to another array
Manage recipe ingredient lists. Copy original recipe ingredients to a new array and display both lists side by side.
Input
Line 1: Number of ingredients n (1-5)
Following lines: Ingredient names (n items)
Output
=== Recipe Ingredients ===
Original Recipe:
1. [ingredient1]
2. [ingredient2]
...
Copied Recipe:
1. [ingredient1]
2. [ingredient2]
...
Total Ingredients: [n] items
Examples
Example 1: Copy 3 Ingredients
Input:
3
eggs
milk
sugar
Output:
=== Recipe Ingredients ===
Original Recipe:
1. eggs
2. milk
3. sugar
Copied Recipe:
1. eggs
2. milk
3. sugar
Total Ingredients: 3 items
❌ 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 10 free executions remaining
