EDIT: Solved
Input File:
Johnson
Sara
6
213 Main St.
Vancouver
BC
Canada
V3B 5N5
604.771.1234
lkj@lkj.com
July 18th, 2004
Monda
Mark
n/a
543 Smith Place
Surrey
BC
Canada
V3N 5M5
604.543.6565
lkj@nom.com
Sept 19th, 2000
Code:
//file input constructor
public Person(BufferedReader inputFile) throws IOException
{
while(inputFile.readLine() != null)
{
familyName = inputFile.readLine();
firstName = inputFile.readLine();
apartmentNum = inputFile.readLine();
houseAndStreet = inputFile.readLine();
city = inputFile.readLine();
province = inputFile.readLine();
country = inputFile.readLine();
code = inputFile.readLine();
number = inputFile.readLine();
email = inputFile.readLine();
birthday = inputFile.readLine();
}
}
Output:
Last name: n/a
First name: 543 Smith Place
Input File:
Johnson
Sara
6
213 Main St.
Vancouver
BC
Canada
V3B 5N5
604.771.1234
lkj@lkj.com
July 18th, 2004
Monda
Mark
n/a
543 Smith Place
Surrey
BC
Canada
V3N 5M5
604.543.6565
lkj@nom.com
Sept 19th, 2000
Code:
//file input constructor
public Person(BufferedReader inputFile) throws IOException
{
while(inputFile.readLine() != null)
{
familyName = inputFile.readLine();
firstName = inputFile.readLine();
apartmentNum = inputFile.readLine();
houseAndStreet = inputFile.readLine();
city = inputFile.readLine();
province = inputFile.readLine();
country = inputFile.readLine();
code = inputFile.readLine();
number = inputFile.readLine();
email = inputFile.readLine();
birthday = inputFile.readLine();
}
}
Output:
Last name: n/a
First name: 543 Smith Place
