Results 1 to 2 of 2

Thread: Calculate Average when some numbers are blank

  1. #1
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Calculate Average when some numbers are blank

    Greetings All,

    I know some of you experts will be able to help me.

    I have a form in Adobe that lists ratings for various tasks, ranking from 1-3. I need to put in a box that tabulates the average for the section. That is itself has thus far been pretty simple.

    My problem is that the number of tasks is variable. There may be 8 tasks on one form, but only 2 on another. Is there a way to calculate the average of only the number of ratings that are actually 1-3, leaving out the ones that have no ratings because there is no task? In other words, I can't just say to calculate the average of the 8 items, because there may be only two tasks that have been rated.

    I hope this makes sense and that someone can help! Thanks in advance for any assistance you can provide.

  2. #2
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    I believe what you are looking for is an ArrayList.
    Take a look at this and see if it is what you need.
    http://java.sun.com/j2se/1.4.2/docs/...ArrayList.html

    It has a variable size and is probably not as fast if you are working with a very large amount of data...but i think it will do
    fine in your case.

    If it is too slow, which could be the case, then just use a normal array and parse through it to remove unneeded information. Afterwords re-size the array (unfortunately java, as far as I know, does not have this built in so you will have to create this method yourself).
    Last edited by TheAlfreds; 02-15-2010 at 11:55 PM.

Bookmarks

Posting Permissions

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