Question: public class TravelDirectionTest { private static void goNorthEast(int endX, int endY, int x, int y, String route) { if (x == endX && y ==
public class TravelDirectionTest { private static void goNorthEast(int endX, int endY, int x, int y, String route) { if (x == endX && y == endY) { System.out.println(route); }else if(x <= endX && y <= endY){ goNorthEast(endX, endY, x, y + 1, route + " N"); goNorthEast(endX, endY,x + 1, y, route + " E"); goNorthEast(endX, endY,x + 1, y + 1, route + " NE"); } //OTHERWISE : DO NOTHING } public static void goNorthEast(int endX, int endY, int startX, int startY) { goNorthEast(endX, endY, startX, startY, "moves:"); } public static void intro(){ System.out.println(); System.out.println(); System.out.println("***************************************************"); System.out.println(); System.out.println(); System.out.println(" \t \t \t \t W E L C O M E "); System.out.println(); System.out.println(" \t T R A V E L T E S T P R O G R A M"); System.out.println(); System.out.println(); System.out.println("***************************************************"); System.out.println(); System.out.println(); } public static void main(String[] args) { intro(); goNorthEast(1,2, 0, 0); System.out.println(); } } Help me do the task list into the code above.
Task List
Print out the solutions for (1, 2).
Create a solution that allows you to travel South, West and South West and returns you back to the origin from your position at (1, 2).
Print out the solutions for (1, 2) returning back to (0, 0).
Step by Step Solution
There are 3 Steps involved in it
Lets break this task into steps to modify the code and accomplish the requirements Print out the solutions for 1 2 The current code already does this ... View full answer
Get step-by-step solutions from verified subject matter experts
