- 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
- Ensure each of the test cases in the class TriangleUtilitiesTest successfully passes upon completion of each of the method stubs in the class TriangleUtilities
String getRow(int width)
String getSmallTriangle()
String getLargeTriangle()
String getTriangle(int n)
- Description
- In the class,
Triangles
Write a method that returns aString
representation of a row of asterisks whose length is equal to thewidth
specified.
- In the class,
-
Sample Script
// : Given int width = 10; // : When String outcome = Triangles.getRow(width); // : Then System.out.println(outcome);
-
Sample Output
**********
- Description
- In the class,
Triangles
Write a method that returns aString
representation of a small triangle, whose base height and base width is 4 asterisks.
- In the class,
-
Sample Script
// : Given // : When String outcome = Triangles.getSmallTriangle(); // : Then System.out.println(outcome);
-
Sample Output
* ** *** ****
- Description
- Write a method that returns a
String
representation of a large triangle, whose base height and base width is 10 asterisks.
- Write a method that returns a
-
Sample Script
// : Given // : When String outcome = Triangles.getLargeTriangle(); // : Then System.out.println(outcome);
-
Sample Output
* ** *** **** ***** ****** ******* ******** *********
- Description
- Given one integer,
n
, generate aString
representation of a triangle whose base height and width is equal ton
.
- Given one integer,
-
Sample Script
// : Given int numberOfRows = 15; // : When String outcome = Triangles.createTriangle(numberOfRows); // : Then System.out.println(outcome);
-
Sample Output
* ** *** **** ***** ****** ******* ******** ********* ********** *********** ************ ************* **************