diff --git a/src/main/java/io/zipcoder/microlabs/mastering_loops/NumberUtilities.java b/src/main/java/io/zipcoder/microlabs/mastering_loops/NumberUtilities.java index 5a742c4..2552802 100644 --- a/src/main/java/io/zipcoder/microlabs/mastering_loops/NumberUtilities.java +++ b/src/main/java/io/zipcoder/microlabs/mastering_loops/NumberUtilities.java @@ -2,27 +2,68 @@ public class NumberUtilities { + + public static String getEvenNumbers(int start, int stop) { - return null; + StringBuilder evenNumbers = new StringBuilder(); + for (int i = start; i < stop ; i++) { + if(i % 2 == 0) + { + evenNumbers.append(i); + } + + } + + + return evenNumbers.toString(); + } public static String getOddNumbers(int start, int stop) { - return null; + StringBuilder builderOddNumbers = new StringBuilder(); + for (int i = start; i < stop ; i++) { + if(!(i % 2 == 0)) + { + builderOddNumbers.append(i); + } + + } + + + return builderOddNumbers.toString(); + } public static String getSquareNumbers(int start, int stop, int step) { - return null; + StringBuilder squareNumbersBuilder = new StringBuilder(); + for (int i = start; i