# 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}}
Asked:
###### Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DeveloperCommented:
Is this an assignment?

If yes, posting assignment questions is against the EE policy, is what I read somewhere.
0
Technical Specialist IVCommented:
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)
0
Senior .Net DeveloperCommented:
``````Dim grades as Integer(,) = {
{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}}
``````

more info:
https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/arrays/how-to-initialize-an-array-variable
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
thanks for the website
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.