File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ function averageForStudent ( nameIndex , scores ) {
2
+ let sum = 0 ;
3
+ for ( let i = 0 ; i < scores . length ; i ++ ) {
4
+ sum += scores [ nameIndex ] [ i ] ;
5
+ }
6
+ let average = sum / scores [ nameIndex ] . length ;
7
+ return average ;
8
+ }
9
+
10
+ function averageForTest ( testIndex , scores ) {
11
+ let sum = 0 ;
12
+ for ( let i = 0 ; i < scores . length ; i ++ ) {
13
+ sum += scores [ i ] [ testIndex ] ;
14
+ }
15
+ let average = sum / scores [ 0 ] . length ;
16
+ return average ;
17
+ }
18
+
19
+ //TODO: Export all functions within an object.
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " Dependencies for Chapter 13 Exercises: Modules" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " This package.json file includes all dependencies needed to run code within files contained in this directory" ,
5
+ "main" : " index.js" ,
6
+ "dependencies" : {
7
+ "readline-sync" : " ^1.4.10"
8
+ },
9
+ "scripts" : {
10
+ "start" : " node index.js"
11
+ },
12
+ "author" : " John Woolbright" ,
13
+ "license" : " ISC"
14
+ }
You can’t perform that action at this time.
0 commit comments