Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help solve this using JAVA! Show me the OUTPUT also. Thank you in advance! a/Local/Packages/Microsoft.MicrosoftEdge 8wekyb3d8bbwe/TempState/Downloadsu 1.1 Count Digits We'll start out with something

Please help solve this using JAVA!
Show me the OUTPUT also.
Thank you in advance!
image text in transcribed
image text in transcribed
a/Local/Packages/Microsoft.MicrosoftEdge 8wekyb3d8bbwe/TempState/Downloadsu 1.1 Count Digits We'll start out with something we've done in class before. Write a function countDigits which takes in an int num, which will return the number of digits in num. For example countDigits should evaluate to: . 1 for numbers 0-9, 2 for numbers 10-99, 3 for numbers 100-999, etc Remember, use repeated division by 10 to calculate the number of digits in num. (There's also a tricky solution using logarithms that avoids the repeated division!) 1.2 nth Digit Back Write a method nthDigitBack hich takes in two ints, n and num. This method finds the nth lowest ordeuldigit in num. In other words, nthDigitBack returns the nth digit from the right. The rightmost digit is considered the oth 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 e nthDigitBack (3,123) 0 8 nthDigitBack (3,18023)

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

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

=+1.3(b), show that a trifling set is nowhere dense [A15].

Answered: 1 week ago