15,881,967 members
1.00/5 (1 vote)
See more:
This is the problem:

Indi wants me to calculate the age of his, but just ask anyone by birth. He remembers that you
You find yourself in the year 1936!

Sorry i'm a begginer xd

They give an example of what I need to have:

-Age: 1905---) His born date can be another number, I mean, It really doesn't metters
-Indi has 31 years

What I have tried:

I tried a lot of things, but my teacher says that the number has to predicted by the user or something like this.
Posted
Updated 29-Sep-22 9:23am
CPallini 29-Sep-22 5:29am
"I tried a lot of things, but my teacher says that the number has to predicted by the user or something like this."
Try to better understand (and report) the actual requirements.
Richard MacCutchan 29-Sep-22 5:50am
Take the current year and subtract the birth year. That will give you the person's approximate age. Reverse the sum to find the year of birth.

## Solution 1

See here: Working with Age: it's not the same as a TimeSpan![^] - the code is C# rather than Java, but it's pretty simple code and you should have no problem working out what is going on and reworking it for Java and your exact assignment.