# Calculating the average, high, and low for each quiz and display them

• 02-17-2010
kchampion
Calculating the average, high, and low for each quiz and display them
I am having trouble writing a code that always a person to enter 5 grades for 5 students. I am using arrays to do this, but I cannot calculate the average out right and getting the high and low numbers to display across the screen. I would like to get some tips thanks!
• 02-17-2010
sababa.sababa
A good tip:
Show us the code...
• 02-17-2010
Lithorien
Well, think about it logically. If you've got an array, say grades[5], what do you know about C and arrays that will make walking it a little easier? (Think pointers!) As for calculating the high and low, can you sort the array so you know that, for example, grades[0] is the lowest and grades[4] is the highest? Or maybe keep track of it with other variables as you walk through the array to add up the grades so you can calculate the average? - I'm just trying to give you a couple ideas to get your brain working, but there's an amazing number of ways to do what you want to do. Try it and see what happens, and if it doesn't work, try it a different way. :)

Also: if it helps, write down the steps on a piece of paper and go from there.