Write java code that inputs a person's birth date (month, day, year) and today's date (month, day,
Fantastic news! We've Found the answer you've been seeking!
Question:
- Write java code that inputs a person's birth date (month, day, year) and today's date (month, day, year). Then call a method CalculateAge() to determine how many years old the person is.
- Convert dates (today's date and the birthdate) to YYYYMMDD format (year * 10000 + month * 100 + day).
- Subtract the birth date from today's date.
- Divide the result by 10000 to get the number of years.
- Return the number of years.
- Display results in main()
- Don't use Array, stick to simple code.
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: