# multidimensional array functions

 Patrick Stark · November 18, 2015 I'm having a problem in my c++ course, here is my assignment:This chapter's program asks you to utilize a multi-dimensional array. Read in from input, where every 6th row represents a new student's grades. Row 1 is attendance, which is out of 10 points, Row 2 is homework, which is out of 30 points.Row 3 is quizzes, which is out of 20 points, Row 4 is midterm which is out of 15 points.Row 5 is Final, which is out of 25 points.  So, the first position in the array, aryData[0][0] will hold the value out of 10 points, aryData[0][1] will be the value out of 30 points, etc..First, read in all of the data into a multidimensional array. Then, call a function that you send the array to and calculate the average of each grade type, such as attendance average is 8, homework average is 27, etc... and output it to the screen.Next, call a function that you send the array to and calculate the average grade for the entire class. Output what the average is for the entire class. So as an example...1020101020515881870 + 54Attendance Avg: 7.5Homework Avg: 17.5Quizzes Avg: 9Midterm Avg: 9Final Avg: 19Student Average: 62At least 5 commentsIt should compileIt should give the correct output as defined I need to know what a function would look like that added 0,0 and 5,0 and divided it by the total possible score to get average. I'm taking online course and my instructor takes days to answer

## Replies

 Scott Walker · November 19, 2015 ``double(double arr1){   int sum = (arr1[0][0] + arr1[5][0])/2;     return sum;}``This would give you the average of the two array elements you mentioned
• 1

## C++

129,747 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
 Bucky Roberts Administrator