Question: IN JAVA Write a method nthDigitBack which takes in two ints, n and num. This method finds the n th lowest order digit in num.

IN JAVA Write a method nthDigitBack which takes in two ints, n and num. This method finds the n th lowest order digit in num. In other words, nthDigitBack returns the n th digit from the right. The rightmost digit is considered the 0 th digit back. nthDigitBack should evaluate to 0 for digits out of range (so if you ask for the 1000th digit back of 7546, nthDigitBack will return 0). Here are some example method calls of nthDigitBack:

nthDigitBack(0,123) 3

nthDigitBack(1,123) 2

nthDigitBack(2,123) 1

nthDigitBack(3,123) 0

nthDigitBack(0,0) 0

nthDigitBack(3,18023) 8

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!