// BdayTDD1.java  P. Conrad 06/07/07
// A simple TDD program to show how we might start the birthday problem
// We are starting with Ben's suggestion of a simple function
// that takes two strings and returns a string.

class BdayTDD1 {

    public static void main(String args[]) {
	
	String bday_Phill = "07/02/1964";

	String bday_TomCruise = "07/03/1962";

	String expectedAnswer = "2 yrs 0 mos 1 days younger";
	

	String actualAnswer = birthdayDiff(bday_Phill,bday_TomCruise);

	System.out.println("actualAnswer=" + actualAnswer);

	if (actualAnswer.equals(expectedAnswer)) 
	    System.out.println("Passed!");
	else
	    System.out.println("Failed!");

    }

    /**
     * birthdayDiff returns a string indicating that the first date
     * 
     */

    public static String birthdayDiff(String firstBday,
				      String secondBday)
    {

	String pieces[] =  firstBday.split("/");

	int year = Integer.parseInt(pieces[2]); 
	int month = Integer.parseInt(pieces[0]); 
        int day = Integer.parseInt(pieces[1]); 

	return (month + "/" + day + "/" + year) ;
    }

}
