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..1b4dcc3 100644 --- a/src/main/java/io/zipcoder/microlabs/mastering_loops/NumberUtilities.java +++ b/src/main/java/io/zipcoder/microlabs/mastering_loops/NumberUtilities.java @@ -3,26 +3,56 @@ public class NumberUtilities { public static String getEvenNumbers(int start, int stop) { - return null; + return getRange(start + (start % 2), stop, 2); } +/* //Kris wrote this, look at it later + public static String getEvenNumbersk(int start, int stop) { // + for ({String s = ""; int i=start;}; i < stop;i++) s = s + ((i % 2 == 0) ? i : ""); + return s; + } +*/ public static String getOddNumbers(int start, int stop) { - return null; + return getRange((start % 2 != 0) ? start : start+1, stop, 2); } - public static String getSquareNumbers(int start, int stop, int step) { - return null; + return getExponentiations(start, stop, step, 2); + } + + public static String getPerfectSquares(int start, int stop) { + StringBuilder sb = new StringBuilder(); + for (int i=start;i