Project: Using Java's Pair Class to Track Owners of Dogs
Tracking Owners of Dogs
As you have probably figured out by now, that movie trailer has nothing to do with this project.
You are to create a program that stores Dog objects and associates each Dog with an owner. You are not allowed to add an owner field to the Dog class because the Dog code belongs to someone else. Instead, you must create an array of Pair objects with each object storing a String and a Dog object. Note that one owner can own more than one Dog. Then create data with at least 20 Dogs and their associated owners. You may store this information in a separate file or hard code it in your program. Make sure you have at least a few examples in your data of one owner owning multiple dogs.
Your program must then repeatedly prompt the user for a String which will represent the owner we wish to search for, on the list. Your program should print out all the dogs owned by this owner. To keep the program simple, you can assume that all owner names will be stored and entered using lower case letters only and will consist of a single token like "fred" so you need not match first and last names.
For each Dog, you must track (and print) its name, age and gender. You can reuse Dog code created in a previous course or write new code if you wish.