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
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

public class BasicUtilities {
public Boolean isGreaterThan5(Integer value) {
return null;
if (value >= 5)
return true;
else return false;
}

public Boolean isLessThan7(Integer value) {
return null;
//test and readme requirement differ. readme <7 & test <= 7
if (value <= 7)
return true;
else return false;
}

public Boolean isBetween5And7(Integer valueToEvaluate) {
return null;
if (valueToEvaluate >= 5 && valueToEvaluate <= 7)
return true;
else return false;
}

public Boolean startsWith(String string, Character character) {
return null;
if (string.substring(0, 1).equalsIgnoreCase(String.valueOf(character)))
return true;
else return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@

public class IntegerArrayUtilities {
public Boolean hasEvenLength(Integer[] array) {
return null;

if ((array.length) % 2 == 0)
return true;
else return false;

}

public Integer[] range(int start, int stop) {
return null;
int size = Math.abs(stop - start)+1;

Integer[] range = new Integer[size];
for ( int i = 0; i < range.length; i ++)
range[i] = start+i;
return range;

}

public Integer getSumOfFirstTwo(Integer[] array) {
return null;
Integer sum = array[0] + array [1];
return sum;
}

public Integer getProductOfFirstTwo(Integer[] array) {
return null;
Integer product = (array[array.length -2] * array [array.length-1]);
return product;
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
package com.zipcodewilmington.assessment2.part1;

public class WuTangConcatenator {
private Integer input;

public WuTangConcatenator(Integer input) {

this.input = input;
}

public Boolean isWu() {
return null;
if (input % 3 == 0)
return true;
else return false;

}

public Boolean isTang() {
return null;
if (input % 5 == 0)
return true;
else return false;

}

public Boolean isWuTang() {
return null;
if (input % 15 == 0)
return true;
else return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
package com.zipcodewilmington.assessment2.part2;

import java.util.Arrays;

public class ArrayUtility {
public Integer[] merge(Integer[] array1, Integer[] array2) {
return null;
int a = array1.length;
int b = array2.length;
Integer[] newArray = new Integer[a + b];
System.arraycopy(array1, 0, newArray, 0, a);
System.arraycopy(array2, 0, newArray, a, b);
return newArray;

}

public Integer[] rotate(Integer[] array, Integer index) {
return null;
}
// int len = array.length;
// int temp;
// Integer[] newArray = new Integer[len];
//// for( int i = 0; i <= index; i++)
//// newArray[i] = array[i + index];
//// return newArray;
//
// temp = newArray[0];
// for (i = 0; i < len - 1; i++)
// newArray[i] = newArray[i + 1];
// newArray[i] = temp;
return null;
}

public Integer countOccurrence(Integer[] array1, Integer[] array2, Integer valueToEvaluate) {
return null;
Expand Down