bob saget
asked on
declare a two dimensional array that can hold 4 grades for 10 students.
how do i declare a two dimensional array that can hold 4 grades for 10 students. Initialize the array with the following grades using {} notation. Column 0 represents Exam 1, column 1 represents exam 2, column 2 represents exam 3, and column 3 represents exam 4. For each exam, print out the average of the exam grade for all students in a listbox. (i have to use a nested for next loop for this. i am also given this code
Dim grades(,) = {
{80, 63, 59, 50},
{96, 97, 98, 94},
{88, 70, 63, 89},
{63, 68, 86, 84},
{72, 84, 86, 63},
{84, 84, 80, 87},
{72, 79, 64, 92},
{89, 63, 99, 65},
{99, 98, 97, 98},
{99, 69, 62, 98}}
Dim grades(,) = {
{80, 63, 59, 50},
{96, 97, 98, 94},
{88, 70, 63, 89},
{63, 68, 86, 84},
{72, 84, 86, 63},
{84, 84, 80, 87},
{72, 79, 64, 92},
{89, 63, 99, 65},
{99, 98, 97, 98},
{99, 69, 62, 98}}
If yes, posting assignment questions is against the EE policy, is what I read somewhere.No, that changed last year, not that I am encouraging it
how do i declare a two dimensional array that can hold 4 grades for 10 students.Okay, so you have this
For each exam, print out the average of the exam grade for all students in a listbox.Add the variable definition add a line break after this to inspect the contents. Notice how the array values are stores (Student, Exam} IOW student 2 scores for exam 3 is in (2,3). This means you have to loop through students and then scores, summing to four variables. After loops divide these variables by the number of students (UBound first dimension)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the website
If yes, posting assignment questions is against the EE policy, is what I read somewhere.