Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified MathUtilities.class
Binary file not shown.
438 changes: 219 additions & 219 deletions MathUtilities.java

Large diffs are not rendered by default.

Binary file modified PredicateUtilities.class
Binary file not shown.
98 changes: 49 additions & 49 deletions PredicateUtilities.java
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@


/**
* Created by dan on 6/14/17.
*/
* Created by dan on 6/14/17.
*/
public class PredicateUtilities {
/**
* @param x
* @param y
* @return true if `x` is greater than `y`
*/
public Boolean isGreaterThan(int x, int y) {
return null;
}
/**
* @param x
* @param y
* @return true if `x` is greater than `y`
*/
public Boolean isGreaterThan(int x, int y) {
return x > y;
}

/**
* @param x
* @param y
* @return true if `x` is less than `y`
*/
public Boolean isLessThan(int x, int y) {
return null;
}
/**
* @param x
* @param y
* @return true if `x` is less than `y`
*/
public Boolean isLessThan(int x, int y) {
return x < y;
}

/**
* @param x
* @param y
* @return true if `x` is greater than or equal to `y`
*/
public Boolean isGreaterThanOrEqualTo(int x, int y) {
return null;
}
/**
* @param x
* @param y
* @return true if `x` is greater than or equal to `y`
*/
public Boolean isGreaterThanOrEqualTo(int x, int y) {
return x >= y;
}

/**
* @param x
* @param y
* @return true if `x` is less than or equal to `y`
*/
public Boolean isLessThanOrEqualTo(int x, int y) {
return null;
}
/**
* @return true
*/
public Boolean returnTrue() {
return null;
}
/**
* @param x
* @param y
* @return true if `x` is less than or equal to `y`
*/
public Boolean isLessThanOrEqualTo(int x, int y) {
return x <= y;
}


/**
* @return true
*/
public Boolean returnTrue() {
return true;
}

/**
* @return false
*/
public Boolean returnFalse() {
return null;
}
/**
* @return false
*/
public Boolean returnFalse() {
return false;
}
}
Binary file modified StringUtilities.class
Binary file not shown.
161 changes: 86 additions & 75 deletions StringUtilities.java
Original file line number Diff line number Diff line change
@@ -1,88 +1,99 @@


/**
* Created by dan on 6/14/17.
*/
* Created by dan on 6/14/17.
*/
public class StringUtilities {
/**
* @return `Hello World` as a string
*/
public static String getHelloWorld() {
return null;
}
/**
* @return `Hello World` as a string
*/
public static String getHelloWorld() {
return "Hello World";
}

/**
* @param firstSegment a string to be added to
* @param secondSegment a string to add
* @return the concatenation of two strings, `firstSegment`, and `secondSegment`
*/
public static String concatenation(String firstSegment, String secondSegment){
return null;
}
/**
* @param firstSegment a string to be added to
* @param secondSegment a string to add
* @return the concatenation of two strings, `firstSegment`, and `secondSegment`
*/
public static String concatenation(String firstSegment, String secondSegment){
return firstSegment + secondSegment;
}

/**
* @param firstSegment a string to be added to
* @param secondSegment a string to add
* @return the concatenation of an integer, `firstSegment`, and a String, `secondSegment`
*/
public static String concatenation(int firstSegment, String secondSegment){
return null;
}
/**
* @param firstSegment a string to be added to
* @param secondSegment a string to add
* @return the concatenation of an integer, `firstSegment`, and a String, `secondSegment`
*/
public static String concatenation(int firstSegment, String secondSegment){
return Integer.toString(firstSegment) + secondSegment;
}

/**
* @param input a string to be manipulated
* @return the first 3 characters of `input`
*/
public static String getPrefix(String input){
return null;
}
/**
* @param input a string to be manipulated
* @return the first 3 characters of `input`
*/
public static String getPrefix(String input){
return input.substring(0,3);
}

/**
* @param input a string to be manipulated
* @return the last 3 characters of `input`
*/
public static String getSuffix(String input){
return null;
}
/**
* @param input a string to be manipulated
* @return the last 3 characters of `input`
*/
public static String getSuffix(String input){
return input.substring(input.length() - 3);
}

/**
* @param inputValue the value to be compared
* @param comparableValue the value to be compared against
* @return the equivalence of two strings, `inputValue` and `comparableValue`
*/
public static Boolean compareTwoStrings(String inputValue, String comparableValue){
return null;
}
/**
* @param inputValue the value to be compared
* @param comparableValue the value to be compared against
* @return the equivalence of two strings, `inputValue` and `comparableValue`
*/
public static Boolean compareTwoStrings(String inputValue, String comparableValue){
return inputValue.equals(comparableValue);
}

/**
* @param inputValue the value input from user
* @return the middle character of `inputValue`
*/
public static Character getMiddleCharacter(String inputValue){
return null;
}
/**
* @param inputValue the value input from user
* @return the middle character of `inputValue`
*/

public static Character getMiddleCharacter(String inputValue){
int lengthString = inputValue.length();
int halfString = lengthString / 2;
int option = (halfString % 2 == 0) ? 1 : 0;
char middleChar = inputValue.charAt(halfString - option);
return middleChar;
}

/**
* @param spaceDelimitedString a string, representative of a sentence, containing spaces
* @return the first sequence of characters
*/
public static String getFirstWord(String spaceDelimitedString){
return null;
}
/**
* @param spaceDelimitedString a string, representative of a sentence, containing spaces
* @return the first sequence of characters
*/
public static String getFirstWord(String spaceDelimitedString){
return spaceDelimitedString.split(" ")[0];
}

/**
* @param spaceDelimitedString a string delimited by spaces
* @return the second word of a string delimited by spaces.
*/
public static String getSecondWord(String spaceDelimitedString){
return null;
}
/**
* @param spaceDelimitedString a string delimited by spaces
* @return the second word of a string delimited by spaces.
*/
public static String getSecondWord(String spaceDelimitedString){
return spaceDelimitedString.split(" ")[1];
}

/**
* @param stringToReverse
* @return an identical string with characters in reverse order.
*/
public static String reverse(String stringToReverse){
return null;
}
/**
* @param stringToReverse
* @return an identical string with characters in reverse order.
*/
public static String reverse(String stringToReverse){
int lengthString = stringToReverse.length();
String[] splitWord = stringToReverse.split("");
String reverseWord = "";
for(int i = lengthString - 1; i >= 0; i--){
reverseWord += splitWord[i];
}
return reverseWord;
}
}
Binary file modified TestMultiplication.class
Binary file not shown.
2 changes: 1 addition & 1 deletion TestMultiplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void testShortMultiplication() {
public void testByteMultiplication() {
// : Given
byte multiplicand = 16;
byte multiplier = 14;
byte multiplier = 4;
byte expectedByte = 64;
// : When
byte actualByte = mathUtils.multiply(multiplicand, multiplier);
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-midnight
Loading