Hi

This is my homework:

"Write a script called *obj13-1.pl* and a library called *obj13-lib.pl*. The
library should contain a function that takes in an array of numbers (of
arbitrary size). The function will then calculate the average of the
numbers, the total of all of the numbers added together, and a new array of
numbers which is the other numbers divided by 2. It will then return a new
list with all of that information.

The script file, *obj13-1.pl* should get a list of numbers from the user
(either via STDIN or a list of arguments) and call the library function."

I don't even know where to start.

Ok so I have a script names obj13-1.pl and a library called obj13-lib.pl. So
for the array I could do: @numbers = 1,2,3,4,5,6,7,8,9,10 (right?)

I'm not sure how to use perl to calculate. How on earth would I go about
calculating the average of these numbers?

I don't get why I even need a library for this, because what do I even put
in the obj13-1.pl. All this is in the library! Or I am totally not getting
this?

Thanks for your assistance

Amichai

Reply via email to