reset password
Author Message
wcwir
Posts: 75
Posted 13:02 May 02, 2019 |

I'll start of this thread with a suggestion: when solving the last question (Matrix Utilities), of the two code samples for multi-dimensional arrays, the MdArrayExamples is the more useful one, as it shows you how to process a "table" of values (which is what a matrix is). 

The ClosestPoints example is a bit different in that the 2D-array in it is not really like a "table" of values; it is a list of things (points), that each have two values in it (x-coordinate and y-coordinate).

Here is something that didn't occur to me until after I posted your lab: You can, if you want, use ClosestPoints as a model for representing data in the second problem in Lab 08 (Compute Grade). Graded items have two values: the number of points a student scored, and the total number of points. In my solution, I store them in two separate arrays (one for points scored, one for total), but you don't have to. If you prefer, you can use a 2-D array that holds "graded items", and each "graded item" can be a 1-D array with two values in it: score and total. This is up to you, and what you find more intuitive.

In either case, you will be summing up the scores and the totals, and however you represent the data (i.e. two 1-D arrays or one 2-D array) you can reuse code from code samples to do it -- look at methods in MdArrayExamples to find what you need.

And when in doubt, or when you come up against something to which you can't find an answer, post questions here.