Question: Please write the following answer in JAVA (not javascript). Please provide answer in copyable text. Show input and output. Thanks in advance. 2) Write a
Please write the following answer in JAVA (not javascript). Please provide answer in copyable text. Show input and output. Thanks in advance.

2) Write a static method and test program for a method called digitRange0 that takes an integer n as an argument and returns the largest difference between the individual digits in the number. For example the call digitRange(68437) should return 5 because the largest difference between individual digits is (8-3). You should test whether the number passed to the method is s- 0 and throw an IllegalArgumentException if not. Passing a 1 digit number should return a 0 (zero). You must test these cases: Method Call Value Returned digitRange(0) 4 digitRange(26) 2 digitRange(42) digitRange(888) digit Range 1234 8 digitRange(24680D 7 digitRange(857492) You can use any techniques you want including Strings. (27 pts) To get full credit, you must show the 8 test values defined above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
