7 pts
Create a function that takes 5 integers that relate to two starting points (start1, start2), two movement speeds (move1, move2), and the number of movements (num). Determine if after the given number of movements (num), the two starting points will finish at the same number after increasing their number by their respective movement speeds. If the two starting points end at the same number, return "YES", otherwise return "NO". Example: multipleMovements(start1, move1, start2, move2, num). multipleMovements(2,4,6,3,5) should return "NO" because after 5 movements, (start1) ended at 22, and (start2) ended at 21.
function multipleMovements(start1, move1, start2, move2, num){
//Enter your code below
}
function multipleMovements(start1, move1, start2, move2, num){
//Enter your code below
}
Test Cases:
-
multipleMovements(5,1,0,2,5) to return YES
-
multipleMovements(3,3,4,4,4) to return NO
-
multipleMovements(9,3,0,6,3) to return YES
-
multipleMovements(2,-3,-1,0,1) to return YES
-
multipleMovements(8,1,4,-2,0) to return NO