gregw is totally correct and for future reference don't ignore clive's advice.

The first program you should write is:

## open data file ## slurp in lines from data file ## foreach your way through the data ## print lines back to verify it was slurped.
The second program you should write is:
## open data file ## slurp in lines from data file ## foreach your way through the data ## parse the line into two scalars ## print the two scalars to verify parsing.
The third program you should write is:
## open data file ## slurp in lines from data file ## foreach your way through the data ## parse the line into two scalars ## stuff the two scalars into two arrays ## print the two arrays to verify stuffing.
The fourth program you should write is:
## open data file ## slurp in lines from data file ## foreach your way through the data ## parse the line into two scalars ## stuff the two scalars into two arrays ## sum all grades ## print the sum ## count the number of grades ## print the number of grades ## calculate the averate ## print the average
This is what I call sneaking up on the project -- step by step.

Later you can go back into the final program and remove unnecessary 'inbetween' variables and do general clean up.

For the moment your questions may resolve around simple things like: "How in the heck do I 'slurp' (a.k.a. read in) a file?" or such things as: "How do I step through a file line by line?"

Good luck.

Claude
p.s. Individual tastes will vary when it comes to selecting which baby steps to take in sneaking up on a program. In general you can bet that trying to do it all at once will introduce too many problems and bugs to deal with.


In reply to Re: I need your HELP!! by Xxaxx
in thread I need your HELP!! by NodeReaper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.