diff options
Diffstat (limited to 'measurement.java')
-rw-r--r-- | measurement.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/measurement.java b/measurement.java index 9557a5f..1883987 100644 --- a/measurement.java +++ b/measurement.java @@ -17,6 +17,8 @@ public class measurement { cow[i] = st.nextToken(); change[i] = Integer.parseInt(st.nextToken()); } + + br.close(); // the milk variables track the amount of milk that each cows was last known to produce int bessieMilk = 7, elsieMilk = 7, mildredMilk = 7; @@ -41,7 +43,7 @@ public class measurement { } // compute the highest milk total and see which cows produced the most milk int highestMilk = Math.max(bessieMilk, Math.max(elsieMilk, mildredMilk)); - boolean bessieOnNext = bessieMilk == highestMilk; + boolean bessieOnNext = (bessieMilk == highestMilk); boolean elsieOnNext = elsieMilk == highestMilk; boolean mildredOnNext = mildredMilk == highestMilk; if(bessieOn != bessieOnNext || elsieOn != elsieOnNext || mildredOn != mildredOnNext) { |