Lab 9: Using Hash Tables
Due Wednesday, November 19
Create a class to represent a chicken breed. For this lab, chicken breeds have the following properties (although you can add extra if you like):
- breed_name (string, name of the breed)
- average_weight (double, average weight for chickens of this breed)
- eggs_per_year (int, average number of eggs per year)
- free_range (string, ability to free range)
- broody (string, likelihood of going broody)
Place at least 5 instances of this class into a hash table, keyed by the name of the chicken. Make sure it's possible to look up the chickens afterward.
You can find stats for chickens online, at websites such as this:
https://www.mcmurrayhatchery.com/chicks.html
Note that in some cases you may have to interpret some specifications to fit into the class above. For example, McMurray lists egg production as a string, such as "best", and your class needs an integer. 300 would be an appropriate number for "best".
Alternatively, feel free to ask ChatGPT or other generative AI to make you a list of chicken specifications.