Hi Pedro,

For your queries..

1. It is not mandatory that the ages are between 3 and 6. It's your choice.
The number of family members to take into account for average age
calculation can be between 3 and 6. For example, if you take 4 members of a
family, say, A, B, C and D with the ages 6, 10, 12 and 16 respectively, then
you would calculate the average age as (6+10+12+16)/4 which is 11.

2. The arguments are passed in the format: name1 age1 name2 age2 and so
on..depending on the number of family members.

Eg: oakdeveloper:~$java NameArray John 12 Jack 13 Tom 11

You can see that the arguments passed in odd numbers, i.e., args[1],
args[3], args[5]... are the ones which contain the ages. So you could pick
them out in your program for average calculation.

Thanks,
Babu

On Thu, Jul 30, 2009 at 9:48 PM, pedro oliveira <[email protected]>wrote:

> Hi,
> I have some questions regarding the Homework exercise of Lab - 1038.
>
> 1 - Regarding numbers of ages, is it mandatory for the program to check if
> the ages passed as command-line arguments are between 3 and 6, or is a
> programmer's choice?
>
>     Because that is a problem when making the average, if the number is
> between 3 and 6, i haven't figure out a way to make the average equation
>
>
> 2 - I can't properly understand how to recieve the arguments in the form
> "name then ages", and only recieve the parameter ages to make the average.
>
>
> Any help would be largely apreciated.
>
> Thank you.
>
> Pedro Oliveira
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to