004-006-005
Array Copy: Recipe Ingredients List
Easy
Problem Description
array Copy: Recipe Ingredients List
In this problem, you will create a program that copies string array elements to another array and displays both the original and copied arrays in numbered list format to standard output.
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
```java
## Examples
### Example 1: Copy 3 Ingredients
Input:
```java
3
eggs
milk
sugar
```java
Output:
```java
=== Recipe Ingredients ===
Original Recipe:
1. eggs
2. milk
3. sugar
Copied Recipe:
1. eggs
2. milk
3. sugar
Total Ingredients: 3 items
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up