From 8ce87145b8b6e2c2465c446cf8e96403dc53ab5c Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Thu, 29 Oct 2020 14:27:38 +0700 Subject: [PATCH] Add comments to GolfScore.java --- Week9/Assignment9/bin/GolfScore.class | Bin 6939 -> 6947 bytes Week9/Assignment9/src/GolfScore.java | 59 +++++++++++++------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Week9/Assignment9/bin/GolfScore.class b/Week9/Assignment9/bin/GolfScore.class index 7d945233f507478262e12524703645fb6e58e737..b9ffb994eda9a97ad23aa464667026246dafabb3 100644 GIT binary patch delta 568 zcmW-dOGs347{!0z{g2&ou6J~Xazcw3QY%ZM&9n-MYSMJ*VcKFSqm8y{)g}V%MGpu! zcU94*h&E;u7ovquB@$)NMI{NDy)=^^WKvV;^x5M3A2|PW&Ug4OBrYd1X~$|@>Fst7 ziTFcKMvB)EU>?v~ZEmqK(1A>|Ud`gUkQ zCk{u5ag;d6SjKVIDsJF}Iy%*JiY898i!-D-t6HeT_G-hibUoYHt{Z}E*5oFPCREbS zdM#GL680)rpc7;#&8jO?Zx!|oj!lcqP;RqdqB$HZuNupqBgzq*hM<2VY)PaWn`;!( zLkZW3lJN$LyI1t8xKHb6mAS2JvMlEgHQZ&LVv>GZ^uLt>?_9}f{JyFmsDF?JJY*4% zSjuCndBPs$+IZ%jk6etr&_lc=%n+r#(xStDU9>ikdad*b2Y92FQK{jrbn#9mcyA^7 zU|r#(F^rjgjGI12OqNfkp9wR_XY-Uv^Ib8=7nA2}z~-Cxy!4>^LldWT(NC>2?KQ_5 z-QQX;rv?8opTB-jY_-H^Rg}jOI4r`L;<#8$ieX9u{E`BHcHyur4$>xt+>?-0NKh)p Rkq#-6lj2I3guUsqs(;v1g~k8? delta 579 zcmXYuOGs347{!0z{ZDhp8OKygQHzi=QW^>ZcOg+IW>aS6Mr@*uwQ1ERf~+Vj2sann zM2m`Ok=4L}6sf(ShZ%0N7h3kx>_uf@hGs`-^FQaF?{&WKp07MznQn@C$>l+FY@d0V zXR)-EloKKhq$=Ds)+H~Jy)n_rde;?A2dCn-t+NDELYOS-a74u`iR*2Zc2M7k$l);g z9HEe-ET)YF$5_R2)(SUqf(FH!I7v)Z4Mg;&q!$TiS(TWnm!qD|cs9Q>pT6VLHn;LVA)xv6S)2MigyTRGq;nMrcexUk?%%@jF zA8F%0DtOFxX)W{z=km_vJ<&b`y311vcrJS{GWGdYq2!?CA@=Y}>8~xpu(k8X#(3*h z^Uk}#d*}Gzb~56+8FD?0x;uPyy^OhjKDqD0NxrxlzJ`3h1%m~9<3H5#rv{D7&aa@k za6^1T27k-oq;B>n(^= 2) + else if (score - par >= 2) return 2; return 0; } @@ -186,11 +187,11 @@ public class GolfScore { // ENTER CODE HERE int[][] playerScores = new int[golfScoreList.length][3]; for (int i = 0; i < playerScores.length; i++) { - for (int j = 0; j < 9; j++) + for (int j = 0; j < 9; j++) //Sum first 9 holes playerScores[i][0] += golfScoreList[i][j]; - for (int j = 0; j < 9; j++) + for (int j = 0; j < 9; j++) //Sum last 9 holes playerScores[i][1] += golfScoreList[i][j + 9]; - playerScores[i][2] = playerScores[i][0] + playerScores[i][1]; + playerScores[i][2] = playerScores[i][0] + playerScores[i][1]; //all hole = index 0+1 } return playerScores; }