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 10:30
Dave has to create animations for a game. which tool can dave use?
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
In simple terms, how would you define a protocol?
Answers: 2
question
Computers and Technology, 25.06.2019 05:30
The piston ring isn't a completely solid ring; instead, it's usually split at one point. this split or gap in the ring is called the a. ring spacing. b. ring clearance. c. ring end gap. d. ring side clearance.
Answers: 2
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
question
Mathematics, 17.09.2021 08:50
question
Mathematics, 17.09.2021 08:50
question
Mathematics, 17.09.2021 08:50
question
World Languages, 17.09.2021 08:50
Questions on the website: 13722362