Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Understand the history of unionization

Answered: 1 week ago

Question

=+Where do you want to live and work?

Answered: 1 week ago