1.Fetch the DOB from an web application(for example 12/12/1999)
2. Calculate the age using DOB (From 12/12/1999 to till today)=24years
3. Then convert this years to Months i.e 24 years 10 months=298 months
4. Fetch the tenure from the application for example =58 months
5. Add total months+tenure=298+58=356
6. Then need to convert the 356 months to years i.e 356/12=29.66(29 round off)
Steps 3-5,6 are more implementations and not requirements
In general we feel that that the following is needed:
get the number of months for a birthday on todays base
return it as totalMonth in a rounded fraction way
so we could also also argue:
Dec-1999: ((31-31)+1) / 31 = 0.032258064516129031 Month
Jan-2000 to Okt-2024 = 24 Years * 12 + 9 Months = 297
today: 14.10.2024: 14/31 = 0.45161290322580644
So: we come up to ~ 297,483870 Months
Compared to: