Summer, 2004: Section 1

Due: Tuesday, 5/25 /04


1. Write a JAVA program that allows the user to enter two names and for each name, one 8-digit integer representing the person's date of birth. Use a Java input dialog box for each data entry. For example, the first name could be Sally with a date of birth of 19840130. We can assume that the user enters good data with 8 digits for each birthday so you do not have to do any error-testing.

2. The program should separate each 8-digit number into three separate numbers to represent the year, month, and day, in that order.

3. Next the program should print out both names, each followed by their date of birth written in the following standard format and displayed in an output window. Do not worry about leading zeroes for days and months. For example:

4. Next the program should determine who is the oldest by testing the value of the numbers and then printing out his/her name as follows, again in a display window:

If the two people were born on the same day, then the message should read:

Hint: Use the % and / operators and Integer Numbers.


Notes about your program: