subject

Various websites like Wikipedia or IMDB list not just a person's birthdate but also the person's current age. Given a person's birthdate and current date, output the person's age in years. Write a method that, given a person's birthdate and current date, returns the person's age in years. The custom is to round down. If the input is 7 1 2000 2 15 2015, the output is 14 (because the person hasn't yet reached their 15th birthday). A person less than 1 has age 0. Input Format: 7 1 2000 2 15 2015 => BirthMonth BirthDay BirthYear CurrentMonth CurrentDay CurrentYear

Hints:

Start by computing currAge just as the difference in years. Then, use an if-else statement to determine whether to decrement currAge.

One reason to decrement is if the current month is less than the birth month (no birthday yet this year).

Another reason to decrement is if the current month equals the birth month, but the current day is less than the birth day.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:30
How will you cite information that is common knowledge in your research paper?
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
Complete the sentence based on your knowledge of the professional difficulties faced by music artists. digital technology allows audiences to see free live telecasts of music or dance performances through
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
If your accelerator suddenly gets stuck what should you do
Answers: 2
question
Computers and Technology, 24.06.2019 12:10
What is it called during the editing process when the processor ensures that a character holding a coffee mug from one angle is holding the same mug in the same way when the shot switches to another camera at another angle? cinematography continuity technology prop use
Answers: 1
You know the right answer?
Various websites like Wikipedia or IMDB list not just a person's birthdate but also the person's cur...
Questions
Questions on the website: 13722363