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
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
31 changes: 22 additions & 9 deletions strangerStrings/StrangerStrings.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
class StrangerStrings {

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

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

getPrefix(input){
return null;
return input.substring(0,3);
}

getSuffix(input){
return null;
return input.substring(input.length-3,input.length);
}

getMiddleCharacter(input){
return null;
}
let position;
let length;

if(input.lrngth %2 == 1){
position = imput.length/2;
length =1;
} else{
position = input.length/2-1;
length = 2;
}
return input.substring(position, position + length);

getFirstWord(input){
return null;
return input.substring(0,6);
}

getSecondWord(spaceDelimnatedInput){
return null;
return spaceDelimnatedInput.substring(7,11);
}

reverse(input){
return null;
let reverseString="";
for (let i = input.length - 1; i>=0;i--)
reverseString +=inout[i];
}
return reverseString;
}
}

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