How do i calculate e age given e year of birth?

how do i calculate e age given e year of birth?

RubberFaceDuckie, two things:
1) please don't crosspost all over the forums.
2) I don't think that it would help much if we tell you the code for such a simple operation; if you have trouble doing this, either go and tell your teacher (maybe the better idea), or try to figure it out alone. This problem shouldn't be unsolvable for you, and it seems to me that you need more practice and to spent more thoughts on your solution. Before you write a program, you should be sure about the program's algorithm.

Similar Messages

  • How do I calculate the age given the year of birth?

    How do I calculate the age given the year of birth?

    Get the current year using the getYear() method. Subtract the year of birth from the current year. The age is calculated.
    d.

  • How do i calculate the age given the dob?

    How do i calculate the age given the dob?

    Date dateOfBirth = yourObject.getDateOfBirth();
    float ageInMillis = System.currentTimeMillis() - dateOfBirth.getTime();

  • How do you calculate the age of a query?

    Hi,
    We are trying to determine how old a query is?  Do one of the statistical cubes/queries contain the age or created on date of a query?
    Thanks for you help.  Points will be rewarded for the correct answer.
    Thanks,
    Mike

    Hi rathi/mike,
    check these tables RSRREPDIR,RSZCOMPDIR.
    Cheers
    RK

  • How do I calculate IRR using months, not years

    When using the IRR funtion in Numbers for Mac (internal rate of return), how do I let the formula know that my time period is months and not years?  In the Excel function, there is an extra arugment in the function that allows you to select the dates and the cash flow for that date.  In the Numbers version, you can only select the cash flows, there is no variable for the dates.  I believe that the function in Numbers automatically assumes you are using years when in fact my cash flows are represented in months (monthly rent from properties).  The function description in Numbers clearly states that you can use months so I must be missing something.  The examples that Numbers provides for using the IRR function all assume the cash flows are in years.
    For non-finance people, the time frame makes an enourmous difference.  If you invest $1.00 with me today and a year from now I give you back $2.00, your return on investment is 100% (you doubled your money) and your IRR is 100% because it took exactly 1 year.  But if I wait five years to give you the $2.00, the return on investment is still 100% (still doubled your money) but the IRR is 20% because it took five years.  Not as good a deal for you and the IRR represents that.  In these scenarios, I can calcullate the IRR using Numbers.  But what if I give you the money back after 6 months?  Or after 18 months?  Or give you .25 cents each month for 8 months?  The IRR will be MUCH different.  How do I tell Numbers my intervals are not in years?
    Thanks for any help!  For two years I've been doing all my spreadsheets in Numbers and then having to calculate the resulting IRR in Excel!! Yuck.

    dB,
    IRR works identically in Numbers and in Office. If that's not the function you want, that's another issue. Here's your IRR calculation in Office (LibreOffice):
    And here it is in Numbers:
    If your payment series is in uniform time periods, why would you use anything besides IRR?
    Jerry

  • How to calculate the Age

    Hi
    I am new to Java, and i am having some problems with calculating some ones age .
    Now the user will enter Today_date and then he will enter his birth_date
    So how can I calculate his age
    Thanks for the help
    Dado

    Here is a very siple one:
    import javax.swing.JOptionPane;
    public class Age     {
         public static void main( String args[] )
              String birth, present, birthday;
              int birthnum, presentnum, age;
              birth = JOptionPane.showInputDialog( "What year where you born in?" );
              present = JOptionPane.showInputDialog( "What year is it now?" );
              birthday = JOptionPane.showInputDialog( "Type 1 if your birthday has "
                                                           + "gone, else type 0" );
              birthnum = Integer.parseInt( birth );
              presentnum = Integer.parseInt( present );
              if ( birthday.equals("1") )
                   age = ( presentnum - birthnum );
              else
                   age = ( presentnum - birthnum ) - 1;
              JOptionPane.showMessageDialog( null, "Your age is: " + age );
              System.exit(0);
    }

  • How do I calculate age?

    Hi again!
    I would like to calculate a registered users age using the
    date of birth inputted by the user. I want to display this age on
    the profile page of the user.
    Does anyone know of an easy way to do this?

    If dateOfBirth is the variable with their date of birth in
    then as follows:-
    <cfset age = dateDiff("yyyy", dateOfBirth,
    now())>

  • Calculate the age in bex

    Dear all,
    What i need is to calculate the age of an equipment, i have date of birth, in report i need to create a formula and subtract date of birth from sy-datum , however i do not know how to define sy-datum in bex variable or formula variable..
    Any help?
    Thanks

    Hi,
    For this First you need to create a Replacement path variable for your characteristic Date(If your Date is a key figure no need of creating this).
    Then search for the standard SAP provided formula variable for current calendar day. once you have found this.
    Create a Formula and in your formula use the formula "Date of Birth - Current Calendar Day" this will give you age in no.of days.
    You would need to divide this by a number based on your requirement to get age in months or years.
    Hope this helps,
    Regards,
    Rk.

  • How do you calculate a field

    Hi all,
    I would really appreciate some help as I do not know programing, java script or other programming languages.  I need to have a field calculate for me.
    The form has date of birth. Then I need the next field, (a text field) calculate the age on the previous field of the Date of Birth.  Does anyone have an idea how to do that?  I have gone through the help guide, but it assume you know the langauage to put in.
    thanks in advance.

    Janet, I've fixed the form and attached the updated version.  There were a couple of things that I changed:
    1. The form was saved as a static .pdf form.  This means that it's for display only; you can't run any scripts and change things programatically.  I changed it to be a dynamic form, which allows scripts to run when the user is entering data.  To do this I selected Save As from the file menu and then selected Save as type: Adobe Dynamic XML Form (*.pdf).
    2. Since the form was saved as static it stripped out the scripts.  I re-pasted the script that I gave you back into the calculate event for the Age field.
    I also changed the Language dropdown on the upper right side of the script window to Javascript, since that's the language that I used.
    3. The name of your DOB field is DateTimeField1.  You can see this by either looking at the Hierarchy window or by looking at the Field tab of the Object window.  In the future you should change the names of the fields from their default to something more descriptive.  For now it's fine.  I then replaced my references to "DOB" in my script with "DateTimeField1.
    4. Make sure that the preview type is set to dynamic.  Go to the File menu in designer and select the Form Properties item.  Click on the Preview tab and choose "Preview Type": Interactive Form and "Preview Adobe XML Form as": Dynamic XML form.
    The above changes made it work, but I changed one more thing:  The type of the DOB field is set to DateTime field, and when you use the pop-up calendar to select the date it gets saved in the data in a backward format (YYY-MM-DD).  This doesn't show up on the form since you have the display format set, but behind the scenes it messes up the date calculation in the script.  I set the edit pattern for the field to be either D/M/YYYY or D-M-YYYY to allow some flexibility when the user enters the date, and to force it to save in the proper format for the script.
    Oh, forgot to mention that "new Date()" gets the current date from the system, so you don't need a field on your form for it.  Green is a comment, not part of the script but just to document what's happening in the script.  Blue means reserved script instruction, black is everything else.  Makes more sense to you if you're a programmer. The Livecycle editor automatically colors the text to make it easier to read, we just type it in.
    Give this a try and let me know if you have more issues.
    Kevin

  • Calculate the age

    hi i am a computer science student new to java i have got this method to calculate the age
    public void calculateAge(Date DateOfBirth)
          String DateInText="12-12-1223";
           try
              Calendar birth = new GregorianCalendar();
              Calendar today = new GregorianCalendar();
              int age = 0;
              int factor = 0; //to correctly calculate age when birthday has not been yet celebrated
              Date birthDate = new SimpleDateFormat("dd-MM-yyyy").parse(DateInText);
              Date currentDate = new Date(); //current date
              birth.setTime(birthDate);
              today.setTime(currentDate);
              // check if birthday has been celebrated this year
              if((today.get(Calendar.DAY_OF_YEAR)) > (birth.get(Calendar.DAY_OF_YEAR)-1))
                  factor = -1; //birthday not celebrated
              age = today.get(Calendar.YEAR) - birth.get(Calendar.YEAR) + factor;
              catch (ParseException e)
             { System.out.println("Given date: "+DateInText+ " not in expected format (Please enter a DD-MM-YYYY date)"); }
        }the only problem is that I would like to get the date of birth from a screen input
    could you help me please?
    thanks very much

    hi ,
    try this code
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Hashtable;
    public class DateHelp {
        /** Creates a new instance of DateHelp */
        public DateHelp() {
            ht.put("1","31");
            ht.put("2","28");
            ht.put("3","31");
            ht.put("4","30");
            ht.put("5","31");
            ht.put("6","30");
            ht.put("7","31");
            ht.put("8","31");
            ht.put("9","30");
            ht.put("10","31");
            ht.put("11","30");
            ht.put("12","31");
        Hashtable ht=new Hashtable();
         static boolean flag=false;
         String retdate="";
        public String getInput()
            try {
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                System.out.println("Enter Your Birth Date(dd-mm-yyyy):");
                String retd=br.readLine();
                String retdsplit[]=retd.split("-");
                if(retdsplit.length<3)
                    System.out.println("Invalid Format");
                    getInput();
                try {
                    int year=Integer.parseInt(retdsplit[2]);
                    if(year%4!=0)
                        ht.put("2","29");
                    int date=Integer.parseInt(retdsplit[0]);
                    int mon=Integer.parseInt(retdsplit[1]);
                    String str=(String)ht.get(retdsplit[1]);
                    if(str==null)
                        System.out.println("Invalid Month ");
                        getInput();
                    else
                        if(Integer.parseInt(str)>=date)
                            flag=true;
                            retdate=retd;
                        else
                            System.out.println("Invalid Date");
                             getInput();
                } catch (NumberFormatException ex) {
                   System.out.println("Invalid Number Format");
                    getInput();
            } catch (IOException ex) {
                ex.printStackTrace();
            finally
                if(flag)
                    return retdate;
                else
                    return "";
        public static void main(String args[])
            DateHelp dh=new DateHelp();
            dh.getInput();
            System.out.println("here:"+dh.retdate);
    }

  • How does the system knows age or seniority is crossed for so and so... EE

    Hi Experts,
    In my project we have configured some Health plans based on ages and seniority,
    Employee can enroll in to the plan when they reach the age or seniority,
    my question is how does the system knows  age or seniority is crossed for so and so... EE, where exactly we do this setups
    Pleae let me know your valuable answers
    Regards
    Sreeni

    hr_entry_date and you can use various
    fm to calculate this, It reads 0019, 0041 or Hdate feature
    3QP8                           Time related calculation function mod.
    HR_AUPBS_SENIORITY             Calculate the whole length of service of employee
    3RP3A                          Leave schem proration modules
    SGPS_LS_SENIORITY_CALCULATION  Function for seniority calculation for Singapore Leave Scheme
    HRDO
    HR_DE_PBS_SENIORITY_PERIODS
    HRFPBS4AV0
    HR_PSF_AV_ANC_INPUT_SENIORITY
    HRF_METADATA_IT
    HRF_READ_SENIORITY_IT

  • How can i calculate mode?

    Hi everyone :)
    I want to know how can i calculate statistical figures....namely, mode(frequency) through java...i take values(results) from a vector.....???
    Can anyone pls help?

    The following algorithm returns all modes in a given data set:
    public Float[] calculateModes(Float[] records)
            // Find the frequency of each record value
            java.util.HashMap<Float, Integer> frequencyMap = new java.util.HashMap<Float, Integer>();
            for (float currentRecord : records)
                if (frequencyMap.containsKey(currentRecord))
                    frequencyMap.put(currentRecord, frequencyMap.get(currentRecord) + 1);
                else
                    frequencyMap.put(currentRecord, 1);
            // Find the modes and add them to a list
            java.util.ArrayList<Float> modes = new java.util.ArrayList<Float>();
            int highestFreq = 0;
            for (Float record : frequencyMap.keySet())
                if (frequencyMap.get(record) > highestFreq)
                    modes.clear();
                    modes.add(record);
                    highestFreq = frequencyMap.get(record);
                else if (frequencyMap.get(record) == highestFreq)
                    modes.add(record);
            return modes.toArray(new Float[modes.size()]);
    }Hope this helps! If anyone finds a faster or more efficient solution please let me know.

  • How can i calculate tempsize and logdir size ?

    Hello:
    I have one database on a primary server and its replica on a replica server.
    Since one week to now, Mexican Exchange have had a considerable growth on transactions.
    My database works in line, every night all data is cleaned waiting for new data on next day.
    From last Thursday (29 april 2010) my replicas have had problems on drop all data using delete from.
    I use delete from because those tables are Oracle cache groups defined.
    Looking for error on tterrors logs (yesterday I got this error) I could see that replica was ran out of temporal memory.
    On line database and replica database I have defined same temporal memory size, on this case 512Mb. But primary database did not send any error about this parameter, so if I checked “monitor” columns on database, my temp_in_use size is too less than temp_allocate_size.
    My problem is, how can I calculate temp_allocate_size ?
    So I have had close to 3,000,000 record on a simple table, I mean, I could have 2 or 3 tables with same number of rows.
    If I have this parameter (may be 9,000,000) rows to be deleted, is there any way to calculate temp_allocate_size ?
    But now, I suppose that I need enogh space on “LogDir”, my high_water_mark for permanent memory is 10GB, I have defined 16 gb for LogDir, but if I stopped replication since the operation starts, I had 100% space used at middle of my operation, so 5Gb on real database used, it is using close to 16 gb on LogDir.
    My second doubt … is there any way to calculate LogDir size having the maximum database size ??
    Thanks a lot for your help.
    Regards.

    I think that approaching this from the perspective of increasing temporary space and log space is not the best way.
    Firstly, there are better ways to delete all rows from a table instead of using delete...
    1. For regular tables (ones that are not part of a cache group) you can use TRUNCATE TABLE ... This operation is replicated but the voilume of replicated data is vastly smaller than if you delete all rows individually. Also, it should take a lot less Temp space on both the source and target system.
    2. For cache tables, you could use UNLOAD CACHE GROUP ... This is similar to TRUNCATE but for cache tables. Again, this operation is replicated. Note that if you are using AWT or SWT cache groups and you DELETE in TimesTen then the data is also deleted from Oracle... is that wjhat is desired?
    If you have to use DELETE then it is very important that you delete the rows in small batches rather than as one huge transaction. Trying to replicate a delete of 3M rows will cause huge problems for replication. A much better solution is to delete in smaller batches using some application logic as follows:
    loop:
    commit;
    DELETE FIRST 1000 FROM sometable;
    If rowcount > 0 then goto loop;
    commit;
    This approach has 5 benefits:
    1. Much less Temp space will be needed.
    2. Replication will be able to process the delets as they occur rather than waiting until all 3M rows have been deleted and then trying to tepliate a single transaction of 3M deletes. This will greatly improve replication performance and also prevent excessive log file buildup.
    3. Checkpointing will be able to purge log files as the delete progresses rather than having to wait until all rowsw have been deleted. This will prevent excessive log file buildup.
    4. The overall time required will be much reduced compared to deleting all rows in a single delete.
    You should not stop replication while the delete s are being done as this just causes log file accumulation.
    To answer your original question. it is not possible ot 'calculate' the required temp space pof log space; rather one must use observed data from when the system is running to determine the necessary size. For Temp size, you can look at the Temp high water mark to see the maximum space used and then set TempSize to somewhat more than that value. For log space, you need enough to sustain the maximum amount of log data generated with some contingency. Running our of log space is a very bad idea...
    If you adopt my suggestions above then you can avoid these issues and also complete the cleanup of data in a shorter time.
    Chris

  • How do I calculate the total size of selected folders?

    Hello
    My question is:
    How do I calculate the total size of selected folders?
    Thank you

    It does show the aggregate size.
    Command-Option-I opens the Inspector window. (Or open the File menu and hold the Option key. Get Info turns into Show Inspector.) The Inspector is similar to the Get Info window but it shows aggregate info for multiple selections. It is also dynamic — if you change the selection while the Inspector is open, the info changes to reflect the current selection.

  • How can we calculate no.of leave used by the employee except sunday.

    Dear Friends,
    i have query how can we calculate no.of leave taken by the employee except sunday & government holiday.
    Example: A person take a sick leave From 13/02/2008 to 20/02/2008 with in that period 17th was sunday.
    when we calculate absence day for that person,Total value is 8 days but exact output is 7days only.How can i get exact result,any function module is avilable for this issue .
    Thanks & Regards,
    Rajkumar.A

    Hi,
    you have to consider SL leave as in holiday's So you can check with clinet if client says consider you can otherwise you con't
    its depend client requirement
    and you can go to controlls inSAP and change absence controlls for SL with holidays
    Regards
    Suresh

Maybe you are looking for

  • Green video error

    I just installed the newest version of quicktime for windows xp, and I'm having a problem with trying to play video for more than a few seconds. When I first play the the videos will automatically start the problem and a flat green color shows up, sh

  • My HP-P6210Y

    OK, my HP-P6210Y prod. # NY545AA#ABA will not stay running. I turn it on and the power button glows blue for about 30 seconds, The fans turn on, everything appears to be working properly in the tower, however the monitor, keyboard, and mouse do not w

  • Getting  Error: SCAC-50012 while using Java Embeding Activity

    Hi, I am using Jdeveloper 11.1.1.4.0 . I am using a Java Embedding Activity in my BPEL and when i compile the project, i got one error------Error: SCAC-50012 The code i am using in Java Embedding activity is java.lang.String TraceLogMessage = null;  

  • Sorting the level value in dimension

    After mapping the dimension table to a dimension, the level value is not in order when quering the data in OWB. How can I sort the data in dimension to a specific order ie, year and month? Thanks for your help Edwin

  • Manually creating buttons

    Please see http://htmldb.oracle.com/pls/otn/f?p=24317:91 I need a button item next to a text box to do some javascript validation and if the validation succeeds do a popupURL. I cant use the builtin button item because a) For HTML buttons, it "hogs"