Question: Using Java 1. In this lab, you must create a static method called getX. This method must accept a String as input and return an

Using Java

Using Java 1. In this lab, you must create a static method

1. In this lab, you must create a static method called getX. This method must accept a String as input and return an integer. The String will be of the form x, y (eg 4, 3), and the method must return the x coordinate which in the example would be 4. 2. You must also create a static method called getY. This method must accept a String as input and return an integer. The String will be of the form x, y (eg 4, 3), and the method must return the y coordinate which in the example would be 3 3. You can assume the x and y coordinates will be single digit integers. 4. Lastly, you must create a static method called getXDistance. This method must accept two Strings in the coordinate form described above. It must use the getX method to get the x coor dinate from each String, and must then return an integer representing the distance between the two x values. This distance must be a positive number. For example, if your getXDistance function receives two Strings 2, 3 and 9, 2, it should return 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!