Pedro,
The average is computed by dividing the sum af the ages by the number of the ages. The number of the ages would be args.length / 2, right?
The ages appear in the args array at indexes 1, 3, 5, 7, etc.. or : for (int i = 1; i < args.length /2; i+=2) {...}
Try it this way.
Marco


pedro oliveira 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