public class DaysAlivePrinter
{
    public static void main(String[] args)
    {
        // Sally Ride was born on May 26 1951
        Day birthday = new Day (1951 , 5 , 26);
       
        // Her last day was July 23 2012
        Day Lastday = new Day (2012 , 7 , 23);
        // Use Day objects to calculate and print
        int DaysAlive = Lastday.daysFrom(birthday);
        // how many days she lived.
        System.out.println(DaysAlive);
        // You'll want to use the daysFrom method.
        // Do you expect to get a negative or a positive number of days?
    }
}

Comments

Popular posts from this blog

The function swapRedGreen has one parameter, a pixel. This function swaps the red and green values and returns the resulting red, green and blue values somehow. Which one of the following is the correct code for this function?