Results 1 to 2 of 2

Thread: I need help on age calculation java programme

  1. #1
    Join Date
    Dec 2010
    In Oman Heart

    idea I need help on age calculation java programme

    Hello everyone,

    I'm a new member in this sites . I study in college and this is my first time in
    studing Object Oriented Programming (Java) . I really need help to find the java code of this programme as soon as possible.

    The question is:
    *By using calnder class Write a program in java to calculate the age in days for the given date of birth.

    If any one has an idea about it tell me please and thank you all.

  2. #2
    Join Date
    Apr 2009

    Re: I need help on age calculation java programme

    What you can do is to first make use of the system.Calendar class. After that what you can do is to take the details from the user given in the e.g. below
    using System.calendar;
    class calendar
    public double a;
    Calendar c = Calendar.getInstance();

    system.out.println(" enter your date of birth);
    System.out.println("YEAR : " + c.get(Calendar.YEAR));
    System.out.println("MONTH : " + c.get(Calendar.MONTH));
    System.out.println("DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    what you can do is to create the select case and create the different birth years as the options so if any of the matching value matches the select case e.g. case 1:2010
    System.out.println("Your age is: DAYS=MONTH*30" +a);
    . If the user enters the option say 2010 then the day will be calculated on the basis of the DAYS=MONTH*30.
    If the user takes the value of say 2009 then you must put the loop as DAYS=MONTH*30+365;
    So just try with this solution hope it may work for you.

Similar Threads

  1. How to records programme ON TATA Sky ?
    By Aadi in forum India BroadBand
    Replies: 1
    Last Post: 01-09-2009, 04:44 PM
  2. transfer programme between two computers
    By oumara.mamane@yahoo. in forum Operating Systems
    Replies: 2
    Last Post: 11-08-2009, 09:27 PM
  3. Calculator Programme in C #
    By Giriraj in forum Software Development
    Replies: 2
    Last Post: 30-03-2009, 03:38 PM
  4. Prime Number programme in C#
    By Harshit in forum Software Development
    Replies: 2
    Last Post: 14-11-2008, 01:09 PM
  5. Dell YouthConnect programme
    By Udumbu in forum Portable Devices
    Replies: 0
    Last Post: 31-10-2008, 06:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts