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 added .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions basicMath/MathUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ class MathUtilities {


add(baseValue, valueToAdd){
return -1;
return baseValue + valueToAdd;
}

subtract(baseValue, valueToAdd){
return -1;
return baseValue - valueToAdd;
}

divide(baseValue, valueToAdd){
return -1;
return baseValue / valueToAdd;
}

multiply(baseValue, valueToAdd){
return -1;
return baseValue * valueToAdd;
}
}

Expand Down
4 changes: 2 additions & 2 deletions basicMath/MathUtilities.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { TestScheduler } = require('jest');
//const { TestScheduler } = require('jest');
const MathUtilities = require('./MathUtilities');

test("Test 1 Integer Addition", () => {
Expand Down Expand Up @@ -74,7 +74,7 @@ test("Test 2 Integer Division", () => {
let addedValue = 1;

// When
let expected = 127;
let expected = 2;
let actual = math.divide(baseValue, addedValue);
//Then
expect(actual).toEqual(expected);
Expand Down
36 changes: 27 additions & 9 deletions strangerStrings/StrangerStrings.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
class StrangerStrings {

getHelloWorld(){
return null;
return "Hello World";
}

concatenation(firstSegment, secondSegment){
return null;
return firstSegment + secondSegment;
}

getPrefix(input){
return null;
let string = "";
string += input[0];
string += input[1];
string += input[2];
return string;

}

getSuffix(input){
return null;
let string = "";
string += input[input.length - 3];
string += input[input.length - 2];
string += input[input.length - 1];
return string;
}

getMiddleCharacter(input){
return null;
let middle = Math.floor(input.length/2);
if (input.length % 2 === 0) {
return input[middle-1] + input[middle];
}else {
return input[middle];
}
}

getFirstWord(input){
return null;
return input.split(" ")[0];
}

getSecondWord(spaceDelimnatedInput){
return null;
return spaceDelimnatedInput.split(" ")[1];
}

reverse(input){
return null;
let splitString = input.split("");
let reverseArray = splitString.reverse();
let joinArray = reverseArray.join("");
return joinArray;
}
}

module.exports = StrangerStrings;
module.exports = StrangerStrings;

4 changes: 2 additions & 2 deletions strangerStrings/StrangerStrings.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { TestScheduler } = require('jest');
//const { TestScheduler } = require('jest');
const StrangerStrings = require('./StrangerStrings');


Expand Down Expand Up @@ -67,7 +67,7 @@ test("return the middle character of `inputValue`", () => {


// When
let actual = strangerStrings.getMiddleCharacter(input);
let actual = strangerStrings.getMiddleCharacter(inputValue);
//Then
expect(actual).toEqual(expected);
});
Expand Down