From 8d32244fdce8379bfe59f3c8a7199f00293d73fb Mon Sep 17 00:00:00 2001 From: tanker405th Date: Tue, 12 Mar 2019 17:13:51 -0400 Subject: [PATCH] Update Exercise_08_22.java If methods for even number of 1s returned true, solution display resulted in "Every row|column does ...........". This fix corrects a returned true statement for either the column or row method to display "Every row|column does have an even number of 1s." --- Exercise_08/Exercise_08_22/Exercise_08_22.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Exercise_08/Exercise_08_22/Exercise_08_22.java b/Exercise_08/Exercise_08_22/Exercise_08_22.java index 44e5467c..5e0c0f04 100644 --- a/Exercise_08/Exercise_08_22/Exercise_08_22.java +++ b/Exercise_08/Exercise_08_22/Exercise_08_22.java @@ -18,11 +18,11 @@ public static void main(String[] args) { // Display if every row and every column have an even number of 1s System.out.println("Every row" + - (isAllRowsEven1s(matrix) ? " " : " does not " + - "have an even number of 1s")); + (isAllRowsEven1s(matrix) ? " does have an even number of 1s" : + " does not have an even number of 1s")); System.out.println("Every column" + - (isAllColumnsEven1s(matrix) ? " " : " does not " + - "have an even number of 1s")); + (isAllColumnsEven1s(matrix) ? " does have an even number of 1s" : + " does not have an even number of 1s")); } /** isAllRowsEven1s returns true is every row has an even number of 1s */ @@ -52,4 +52,4 @@ public static boolean isAllColumnsEven1s(int[][] m) { } return true; } -} \ No newline at end of file +}