forked from LaunchCodeEducation/javascript-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.js
More file actions
36 lines (31 loc) · 886 Bytes
/
display.js
File metadata and controls
36 lines (31 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//TODO: Export ONLY the printAll function.
function printAll(names, tests, scores){
let header = 'Name';
let row = '';
for (let i = 0; i<tests.length; i++){
header += '\t'+tests[i];
}
console.log(header);
for (let name = 0; name<names.length; name++){
row = names[name];
for (let score = 0; score<scores[name].length;score++){
row += '\t'+scores[name][score];
}
console.log(row);
}
return;
}
function printStudentScores(index,students,tests,scores){
console.log(`Test results for ${students[index]}:`);
for (let i = 0; i<tests.length; i++){
console.log(`${tests[i]} = ${scores[index][i]}%.`);
}
return;
}
function printTestScores(index,test,students,scores){
console.log(`Class results for ${test} test:`);
for (let i = 0; i<students.length; i++){
console.log(`${students[i]} = ${scores[i][index]}%.`);
}
return;
}