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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!