- 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 aString
concatenation of all integers between0
up 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 aString
concatenation of all integers betweenstart
up 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
, andstep
return aString
concatenation 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 aString
concatenation of all even integers betweenstart
up 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 aString
concatenation of all even integers betweenstart
up 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 aString
concatenation of all values squared betweenstart
up 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 aString
concatenation of all values, raised to the specifiedexponent
, betweenstart
up 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