The dilemma I am having is that all of my names and scores are currently in one array.
That is indeed your problem. Let's fix that. In fact you have a bunch of students. To represent "a bunch of" we use an array: @students = (); Each student has a final exam grade and probably a student ID:
@students = ( { 'id' => 123, 'final'=> 94 }, { 'id' => 321 'final'=> 90 } );
Each student also has a bunch of quizzes. "A bunch of" is called an array, so:
@students = ( { 'id' => 123, 'final'=> 94, 'quiz' => [ 88, 45, 91 ] }, { 'id' => 321, 'final'=> 90, 'quiz' => [ 81, 93, 90 ] } );

Now that our Perl data structure accurately represents the real world, the code to manipulate it is straightforward.

"Bad programmers worry about the code. Good programmers worry about data structures and their relationships." Linus Torvalds

Note - the single quotes around the hash keys such as 'final' aren't required. That's just my personal preference for style, since barewords aren't good in *general* I don't like having something that *looks* like a bareword.

In reply to Re: Weighted averages by raymorris
in thread Weighted averages by drose2211

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.