My youngest son loves numbers and statistics. He often asks "How many seconds old am I?" or "How old is Mama in minutes?". I decided to write a program for him that would display the ages of everyone in our family in seconds, minutes, hours, days, months, and years. It also displays some summary information, such as average age, relative age, and how many days until the next birthday.
The program reads from an XML file to get the data about names and birth dates, so it is easy to add or remove names without changing the code in case my son decides the program should include his pet dog or turtle.
Retrieving Names and Birthdates
The first thing the program does is fill a string array "Names" and a DateTime array "BirthDate" with the data from the XML file.