Question: 5 Lab 2 c - More complex methods In this lab, you must create a static method called get x . This method must accept
LabcMore complex methods
In this lab, you must create a static method called get This method must accept a String as input and return an integer. The String will be of the form and the method must return the coordinate which in the example would be
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 andthemethod the coordinate which in the example would be
You can assume the and coordinates will be single digit integers.
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 get method to get the coordinate from each String, and must then return an integer representing the distance between the two values. This distance must be a positive number. For example, if your getXDistance function receives two Strings and it should return
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
