// So we can use the short form for the names of Input/Output routines, we...
import java.io.*; 
// Otherwise we would have to write things like 
// java.io.InputStreamReader instead of InputStreamReader

public class InputDemo {
	public static void main(String [] args) throws IOException {
		// We create a few people, based on user input
		
		/* Reading from standard input (the keyboard)

		Unfortunately there are many levels of filtering on the input

		System.in is the raw input
		isr reads the raw input, converts it to a stream
		in buffers the input stream
		*/
		InputStreamReader isr=new InputStreamReader(System.in);
		BufferedReader in=new BufferedReader(isr);

		/* Same as
		BufferedReader in;
		in=new BufferedReader(new InputStreamReader(System.in));
		*/

		Person p1,p2,p3;

		String line;
		int height;

		System.out.print("Give me the persons name:");
		line=in.readLine(); // read 1 line of user input

		p1=new Person(line);

		System.out.print("Give me the persons height:");
		line=in.readLine(); // read 1 line of user input

		// p1.setHeight(line) // Not allowed, line is a string, 
		//                       an integer is expected

		// figure out which integer is represented by line
		height=Integer.parseInt(line); 

		p1.setHeight(height);

		System.out.print("Give me the persons name:");
		line=in.readLine(); // read 1 line of user input
		p1=new Person(line);
		System.out.print("Give me the persons height:");
		line=in.readLine(); // read 1 line of user input
		height=Integer.parseInt(line); 
		p1.setHeight(height);

		System.out.println("Population is "+Person.getPopulation());
		System.out.println("totalHeight is "+Person.totalHeight);
	}
}
