Question: by java Task 2 Last Digit: Write a method called lastpigit that returns the last digit of an integer. For example, the call lastDigit( 3572)

by java  by java Task 2 Last Digit: Write a method called lastpigit

Task 2 Last Digit: Write a method called lastpigit that returns the last digit of an integer. For example, the call lastDigit( 3572) should return 2. It needs to work for negative numbers as well. For example, the call lastDigitl-5489) return 9. Complete this by having your main method call your method with the above arguments. Task 3 Distance: Write a method called distance that accepts a Scanner as a parameter. The method should query the user for two coordinates and then return the distance between the two coordinates.. Example output:. Enter the first coordinate: 10 Enter the second coordinate: 4 4 distance: 5.0 User input is bolded and underlined.. Complete this by having your main method call your method and use the values (10, 2) and (3, 15)

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!