Current Date - Birth Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stormrider
    New Member
    • Jan 2007
    • 11

    Current Date - Birth Date

    Hi all,
    I'm trying to implement a Perl structure.
    My small program will do the followings;
    Take the birth date of the user as input.
    (Month's will be input as strings.)
    Take the current time from the operating system.
    Then calculate and display the age of the user as;
    x years, x moonths and x days.
    I also want to add a day/month counter,
    so that the program will calculate and display the age of the user as;
    x days, x months

    So, I plan the program to work as follows;
    Code:
    Enter your birth date: 21 November 1975
    Enter the current date: 9 January 2007 //if i can't implement a get_system_time function
    Your age is: 31 year(s) 1 month(s) 19 day(s)
    You've been living for 11364 days or 378 months.
    I'd be glad to hear some help about this small implementation.
    Thanks all..
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    Are all the functions and modules that you'll need:



    Comment

    • stormrider
      New Member
      • Jan 2007
      • 11

      #3
      Thank you for the functions miller..

      Can anyone please also send me a body for my program.
      I am really new at Perl and wondered how a structure works like my example.
      I searched some code for this but couldn't find something alike.
      If anyone posts some solution code, I'd like to examine it step-by-step,
      and compile it on my mind for study..
      Thank you all..

      Comment

      • miller
        Recognized Expert Top Contributor
        • Oct 2006
        • 1086

        #4
        No, people will not write your program for you.

        This is obviously a homework assignment, as I've been asked this exact question in another forum. Write it yourself, and if you a specific problem feel free to post the code that you're having trouble with.

        Don't expect people to write your code for you. I've already given you links to all the functions and modules you will need.

        Comment

        • stormrider
          New Member
          • Jan 2007
          • 11

          #5
          Ohh.. I think I was misunderstood.
          Anyway, thanks again for your interest..

          Comment

          Working...