Question: Done in Java. Any help is appreciated. 1. Create a class named Lab3Exercises and Implement the following static methods (we will not use this class

 Done in Java. Any help is appreciated. 1. Create a class

Done in Java. Any help is appreciated. 1. Create a class named Lab3Exercises and Implement the following static methods (we will not use this class to instantiate objects) and write JUnit tests when asked: a) public static int my 1089Puzzle (int mylnput) i. Implement a function that receives an integer from user in main method) and does the following: Discard all but last 3 digits. Reverse these digits, subtract the original (input) from the reversed (discarding any minus sign), reverse the digits of the difference, and add the difference and the reversed difference. Then return the sum (which should be printed in main). For examples: Input: 371 Reversed: 173 Difference: 198 Reversed: 891 Sum: 1089 For smaller numbers, assume preceding zeros. Few things to remember: Assume only positive integers are the inputs. You can ignore palindrome inputs which return a value of O for difference. For ex., 404. May be return -1. If you get numbers less than 100 after reversal, you should be adding leading zeroes. For ex., 2 should be 002, 99 should be 099. ii. Use the Scanner class to get input from the user in main method) and pass that as a parameter to the method above. Get the returned value and print it along with the user input. iii. After thorough testing, Write appropriate JUnit tests

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!