I have a do while loop that asks for 2 forms of input 3 times.
I thought about putting these inputs into 2 arrays to be output later, but it ain't working.
Here's my code for you to look at:
int i = 0;
do {
System.out.print("Enter a name ");
String name = scanner.nextLine();
System.out.print("Enter age ");
String age = input.nextLine();
newAge = Integer.parseInt(age);
i++;
} while (i <= 3);
I want to output the values as such:
Names are: Name1; Name2; Name3
But I want to add the 3 ages together to make a totalAge variable.