QUOTE(jpconleyiv @ 29 Apr, 2009 - 05:27 PM)

Ok so this what I have worked out since the last post, Thank you SixOfEleven. What I am still racking on are these few things.
1. Is my variable declared correctly- string name [num students]
2.Is it ok to initiate quizzes to 0
3. After the two nested loops, and once in the display module how do I set it up to know what the eight highest score are. At the end it has to print students name, and the total points for each students eight highest scoring quizzes.
CODE
Start
string name [num students]
num students = 21
num quizzes = 0
num quizScore [num students] [num quizzes]
num x = 1
num y = 1
get name, quizScore
while x < students + 1
while y < quizzes + 1
y = y + 1
endwhile
x=x +1
endwhile
perform BubbleSort (num quizScore[], num students)
DisplayArray (num quizScore[], num students)
Stop
void BubbleSort (num quizScore[], num students)
void DisplayArray(num quizScore[], num students)
num x = students – 1
while x > 0
print name, quizScore[x]
x = x – 1
endwhile
return
Thanks Again!!!!
You are getting closer but not quite. The order of your variables is a little wrong and the declaration is not quite right. You would want to put them like this:
CODE
num students = 20
num quizzes = 10
string name [students]
num quizScore [students] [quizzes]
Your while loops are not quite right either, I admit I omitted something in my previous post you need to set y = 1 before you start the inner loop. You would want something along this lines:
CODE
while x < students + 1
get name[x]
y = 1
while y < quizzes + 1
get quizScore[x][y]
y = y + 1
endwhile
x=x +1
endwhile
Can you see why you would want to do that?
After you do that you will want to make a second loop that would go through each student, copy their scores to an array, sort that array and display the results. From what I've shown you see if you can figure it out. If you can't feel free to leave another post and I'll try and help you out.