Question: LinkedList Create a java program that allows the user to enter as many names and birthdays as they like. Each of these should be stored
LinkedList
Create a java program that allows the user to enter as many names and birthdays as they like. Each of these should be stored in an object of the supplied Birthday class. You must create an InvalidBirthdayException that will be used by Birthday. Your drivers should handle the exceptions thrown. Once the names are entered, you should print the list using the Birthday toString() method. Finally, create an iterator to traverse the list and return the oldest person in the list.
Additional instructions/hints.
The birthday class contains two instance variables, a String name and an int bday. Defaults will be Fred with a birthday of 20160714.
Birthdays should be entered in the format yyyymmdd.
You should structure your program with methods, recommend one to enter the values for the list, one to print the list, and one to find the oldest.
findOldest must use an iterator to traverse the list, you are not allowed to sort on the birthday to find the oldest. printList can use an enhanced for to print the contents of the list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
