Closed frankcollins3 closed 1 year ago
first approach is minimum viability based: just loop over 1 student and get 5 random test scores.
// Now how to do a forloop instead of foreach to limit loop by 5
foreach should be automatically constrained in its loop count by array contents but double checking [10:51pm]
👍 int[] sophia = new int [5]; int[] andrew = new int [5]; int[] emma = new int [5]; int[] logan = new int [5];
// 2d matrix array
int[][] studentArrays = new int[4][];
studentArrays[0] = sophia;
studentArrays[1] = andrew;
studentArrays[2] = emma;
studentArrays[3] = logan;
[11:39am]
attempting to do: initialize Length == 5 array that holds 5 test scores to gather averages.
wrote a cb() that takes (student: string) (grade: number) params to: print to Console a msg returning the letter grade (A+ .. D- .. F etc) to correspond to number of grade.
aiming to make an array of all the students names and loop over the array and create random values
error: conceptualizing the plan of array use.
proposed approach: 2d matrix ?
0: can also hard code things but want to be more algorithmic.