Age Calculator Demo in Java v1.0
Submitted By:
bharathh
Rating:





(
Rate It)
Share:
By Email
A simple program that calculates in years, months, and, days the number of days that a person has lived for since his/her date of birth.
Most age calculators that I found online were all wrong so I thought I'd create one of my own. It has an agecalculator object that can basically calculate the age difference between any two dates with a little modification. Currently the upperbound date is set to the date that the program is run on.
I've tried to write REALLY clean code, but please do send in your comments and feedback on what you think about it.
README is included in the source.
NOTE: Some downloads must be obtained through publishers´s site.
Do you want to get your software listed on this site? Go to our
submissions area.
Screenshot
Details
Number of downloads:
1497
Comments (4)
visit




Posted by: bhavesh on Wednesday, January 28, 2009
its nice!!!!!!!!!!!!11
Very useful




Posted by: rv.kalpana on Sunday, February 15, 2009
Hi ur right.. there is no perfect age calculator in java on net.. after exhaustive search i found urs...its very useful.. thank u..
this code is wrong




Posted by: proj manager on Friday, April 24, 2009
to correct:
in file AgeCalculator.java line 201 should be
dayToday += dayBorn;
best regards
Please find my agecalculator(normal)




Posted by: Suren on Thursday, August 09, 2012
import java.io.*;
class AgeCalculator{
public static void main(String args[])
{
InputStreamReader ins=new InputStreamReader(System.in);
BufferedReader hey=new BufferedReader(ins);
try{
System.out.println("Please enter your name: ");
String name=hey.readLine();
System.out.println("Please enter your birth date: ");
String date=hey.readLine();
System.out.println("please enter your birth month:");
String month=hey.readLine();
System.out.println("please enter your birth year:");
String year=hey.readLine();
System.out.println("please enter current year:");
String cYear=hey.readLine();
int bDate = Integer.parseInt(date);
int bMonth = Integer.parseInt(month);
int bYear = Integer.parseInt(year);
int ccYear=Integer.parseInt(cYear);
int age;
age=ccYear-bYear;
int totalMonth=12;
int yourMonth=totalMonth-bMonth;
System.out.println(" Hi " + name + " your are " + age + " years " + yourMonth + " months old ");
}
catch(IOException err)
{
System.out.println("");
}
}
}
Add Your Rating