Question
Using Java programming language, write the following: Create enumerated data type for Day and Month in its own separate file. Then use it to hard
Using Java programming language, write the following:
Create enumerated data type for "Day" and "Month" in its own separate file. Then use it to hard code the birth dates (Day - enum, Month - enum, and Year - int) of your top 10 favorite US presidents as president objects stored in a sorted array. Then build a system in which the users enter their date of birth using the enumerated types and check to see if they have the same birth Month as a US president. If they do, also calculate the difference between the user and that president's birth years and report it on the screen as part of a congratulatory message. If they don't match any of them then print a message that they don't exactly match any president's birth date but tell them which president their birth date is closest to.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
lets start by creating the enumerated data types for Day and Month Well then define the President class create an array of President objects for our top 10 favorite US presidents and finally implement ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started