/**
	Practice with writing functions.
	
	@author Terry Sergeant
	@date   25 Oct 2006

	<pre>
	1. Compile and run the program to make sure it works as expected.
	2. Re-run the program in "debugging" mode so that you can trace 
		 the execution line by line.  Set a breakpoint at the first
		 method call.  Experiment with the step-over and step-into
		 commands.  Do you understand the difference? 

		 Also, when running the debugger observe the values of variables
		 being "watched".  Notice what happens to the variables in the
		 formal parameter list as the function is called.

	3. Modify this program by adding a brand new function called
		 showOlder that will accept the names and ages of two people
		 as parameters.  The function should display the name of the
		 person who is older.

	4. From main, call the function two times with two sets of actual
		 parameters.  In one call make the first person older and in the
		 second call make the second person older.
	</pre>
*/


import java.util.Scanner;

public class FuncPractice
{
	public static void main(String [] args)
	{
		Scanner scan;
		int idnumber, age;
		String firstname;

		scan= new Scanner(System.in);

		printInfo(1234,"Henry",40);
		printInfo(2345,"Yolanda",25);

		System.out.print("Enter your id number: ");
		idnumber= scan.nextInt();
		System.out.print("Enter your age      : ");
		age= scan.nextInt();
		System.out.print("Enter your name     : ");
		firstname= scan.next();

		printInfo(idnumber,firstname,age);
	}

	/** prints id, name, and age "real pretty like". */
	public static void printInfo(int id, String name, int age)
	{
		System.out.print("--------------------\n");
		System.out.println("Info for ID # " + id);
		System.out.print("--------------------\n");
		System.out.println("Name: " + name);
		System.out.println("Age : " + age);
		System.out.print("--------------------\n");
	}
}
