Change array initializer location
This commit is contained in:
parent
d252f6ef50
commit
cb435fae59
Binary file not shown.
|
@ -32,7 +32,6 @@ public class GolfScore {
|
|||
public static void run(String scoreFile) {
|
||||
// 1. get golfer's names from golf-score-1.csv
|
||||
String[] golfers = getGolfers(scoreFile);
|
||||
|
||||
// 2. get golfer's scores from golf-score-1.csv
|
||||
int[][] golfScoreList = getScores(scoreFile);
|
||||
|
||||
|
@ -149,7 +148,7 @@ public class GolfScore {
|
|||
*/
|
||||
public static int[] calculateHandicap(int[][] scores, int[] par) {
|
||||
// ENTER CODE HERE
|
||||
int hc[] = new int[scores.length]; //create a handicap array of nGolfers elements
|
||||
int[] hc = new int[scores.length]; //create a handicap array of nGolfers elements
|
||||
for (int i = 0; i < scores.length; i++) //Loop through each row
|
||||
for (int j = 0; j < scores[i].length; j++) //Loop through each hole
|
||||
hc[i] += calculateHoleHandicap(par[j], scores[i][j]); //no. golfer = row = i+1; no. hole = column = j+1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven Integration for Eclipse
|
||||
#Thu Oct 29 15:42:14 ICT 2020
|
||||
#Thu Oct 29 16:39:34 ICT 2020
|
||||
m2e.projectLocation=C\:\\Users\\siwat\\GitHub\\ise-comprog-after-midterm\\screwdriver-3.5.6
|
||||
m2e.projectName=screwdriver-3.5.6
|
||||
groupId=it.ramecera.ict
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#Generated by Maven Integration for Eclipse
|
||||
#Thu Oct 29 15:42:21 ICT 2020
|
||||
#Thu Oct 29 16:39:34 ICT 2020
|
||||
m2e.projectLocation=C\:\\Users\\siwat\\GitHub\\ise-comprog-after-midterm\\waxds-copper
|
||||
m2e.projectName=waxds-copper
|
||||
groupId=it.ramecera.ict
|
||||
|
|
Loading…
Reference in New Issue