about | help | code help+videos | done | prefs |
Write a method that accepts the x and y values of an initial point and a string representing the 'moves' to be made. Each move consists of a letter 'U' for up, 'D' for down, 'L' for left, and 'R' for right. You need to return a string that represents the coordinates of the final point you reach after making all the 'moves'. Look at the test data for examples and to see how each move changes the coordinates. As preconditions you may assume that 'moves' will ONLY contain characters from 'U', 'D', 'L', 'R'. test2022_11_03_HL_newPosition(5, 7, "UUDLUDDR") → "(5,7)" test2022_11_03_HL_newPosition(3, 1, "UUUUUUU") → "(3,8)" test2022_11_03_HL_newPosition(-5, -2, "U") → "(-5,-1)" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy