the aim is to have 5 users to input data into their program and to output 5 people that have entered their details respectively. any hints would be great =)
import java.util.*;
public class Person
{
// Tests the methods of the Person File
public static void main(String [] args)
{
int [] i = new NewPerson[5];
Scanner input = new Scanner(System.in);
for (int i = 0; i <= i.length ; i++)
{
System.out.print("Please enter your Forename ");
String FName = input.next();
System.out.print("Please enter your Surname ");
String LName = input.next();
System.out.print("Please enter your Age ");
int AAge = input.nextInt();
System.out.print("Please enter your Height ");
int AHeight = input.nextInt();
PersonTest person1 = new PersonTest(FName, LName, AAge, AHeight);
person1.format();
System.out.println("The number of Persons entered are " + (i));
}
}
}
import java.util.*;
public class Person
{
// Tests the methods of the Person File
public static void main(String [] args)
{
int [] i = new NewPerson[5];
Scanner input = new Scanner(System.in);
for (int i = 0; i <= i.length ; i++)
{
System.out.print("Please enter your Forename ");
String FName = input.next();
System.out.print("Please enter your Surname ");
String LName = input.next();
System.out.print("Please enter your Age ");
int AAge = input.nextInt();
System.out.print("Please enter your Height ");
int AHeight = input.nextInt();
PersonTest person1 = new PersonTest(FName, LName, AAge, AHeight);
person1.format();
System.out.println("The number of Persons entered are " + (i));
}
}
}