- Ensure each of the test cases in the class NumberUtilitiesTest successfully passes upon completion of each of the method stubs in the class NumberUtilities.
String getEvenNumbers(int start, int stop)String getOddNumbers(int start, int stop)String getSquareNumbers(int start, int stop, int step)String getRange(int start, int stop, int step)String getExponentiations(int start, int stop, int step, int exponent)
- Description
- Given an integer,
stop, return aStringconcatenation of all integers between0up to and not includingstop.
- Given an integer,
-
Sample Script
// : Given int stop = 11; // : When String outcome = NumberUtilities.getRange(stop); // : Then System.out.println(outcome);
-
Sample Output
012345678910
- Description
- Given two integers,
start, andstop, return aStringconcatenation of all integers betweenstartup to and not includingstop.
- Given two integers,
-
Sample Script
// : Given int start = 5; int stop = 11; // : When String outcome = NumberUtilities.getRange(start, stop); // : Then System.out.println(outcome);
-
Sample Output
5678910
- Description
- Given three integers,
start,stop, andstepreturn aStringconcatenation of all integers betweenstart, incrementing bystep, up to and not includingstop.
- Given three integers,
-
Sample Script
// : Given int start = 5; int stop = 20; int step = 5; // : When String outcome = NumberUtilities.getRange(min, max, step); // : Then System.out.println(outcome);
-
Sample Output
51015
- Description
- Given two integers,
start, andstop, return aStringconcatenation of all even integers betweenstartup to and not includingstop.
- Given two integers,
-
Sample Script
// : Given int start = 5; int stop = 20; // : When String outcome = NumberUtilities.getOddNumbers(min, max); // : Then System.out.println(outcome);
-
Sample Output
681012141618
- Description
- Given two integers,
start, andstop, return aStringconcatenation of all even integers betweenstartup to and not includingstop.
- Given two integers,
-
Sample Script
// : Given int start = 5; int stop = 20; // : When String outcome = NumberUtilities.getOddNumbers(min, max); // : Then System.out.println(outcome);
-
Sample Output
5791113151719
- Description
- Given two integers,
start, andstop, return aStringconcatenation of all values squared betweenstartup to and not includingstop.
- Given two integers,
-
Sample Script
// : Given int start = 5; int stop = 20; // : When String outcome = NumberUtilities.getOddNumbers(min, max); // : Then System.out.println(outcome);
-
Sample Output
25100225
- Description
- Given four integers,
start,stop,step, andexponent, return aStringconcatenation of all values, raised to the specifiedexponent, betweenstartup to and not includingstop, incrementing by the specifiedstep.
- Given four integers,
-
Sample Script
// : Given int start = 5; int stop = 20; int step = 5; int exponent = 2; // : When String outcome = NumberUtilities.getOddNumbers(min, max); // : Then System.out.println(outcome);
-
Sample Output
25100225