Question
JAVA use 2 different arrays and for loops to store and get info from the user. Each time you go through the loop ask for
JAVA
use 2 different arrays and for loops to store and get info from the user. Each time you go through the loop ask for a name and an age and put these values into an array of strings and array of integers. Loop through the two arrays and print values.
Prompt user for a certain number of children
create int array and string array to hold the names and ages of the children that were inputted
Prompt user input for the name of the kid and their corresponding age and store values in the arrays. After user input has been entered, print the children's names and their age
sample output:
Enter total number of children
4
Enter the name of kid 1:
Steve
Enter the age for kid 1:
11
Enter the name of kid 2:
Brendan
Enter the age for kid 2:
14
Enter the name of kid 3:
Mason
Enter the age for kid 3:
19
Enter the name of kid 4:
Liam
Enter the age for kid 4:
17
You have entered the following:
Name age
Steve 11
Brendan 14
Mason 19
Liam 17
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started