Question: 5 Lab 2 c - More complex methods In this lab, you must create a static method called get x . This method must accept

5 Lab2c-More complex methods
In this lab, you must create a static method called get x. This method must accept a String as input and return an integer. The String will be of the form x,y(eg4,3), and the method must return the x coordinate which in the example would be 4.
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(eg4,3),andthemethodstreturn the y coordinate which in the example would be 3.
You can assume the x and y 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 x method to get the x coordinate 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.
 5 Lab2c-More complex methods In this lab, you must create a

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!