Question: Question 01: An n-digit positive integer d1d2d3-.. dn-1 dn satisfies property A if the sum of the nth powers of its digits is equal to

 Question 01: An n-digit positive integer d1d2d3-.. dn-1 dn satisfies property

Question 01: An n-digit positive integer d1d2d3-.. dn-1 dn satisfies property A if the sum of the nth powers of its digits is equal to the number itself Examples of integers satisfying property A: 6-61 1634 14+ 64+ 3444 1531353 33 Write a Java program consisting of the main method and a private static boolean method that takes an integer and it returns true if the integer satisfies property A; otherwise it returns false. The main method prompts for and reads an integer, it then determines whether the integer satisfies property A or not by using the boolean method Note: . The boolean method must throw java.lang.lllegalArgumentException if it is passed an integer less than one . The main method must recover from both java.util.InputMismatchException and java.lang.lllegalArgumentException by looping until a valid value is entered The behaviour of your program must be similar to the program runs below: . Input a positive integer number to check if it satisfies property A: -2 java.lang. IllegalArgumentException: parameter less than 1 input a positive integer number to check I 1t 3atisties property A: five java.util.InputMismatchException Input a positive integer number to check if it satisfies property A: 153 The number 153 satisfies property A. Input a positive integer number to check if it satisfies property A: 1634 The number 1634 satisfies property A Input a positive integer number to check if it satisfies property A: 54748 The number 54748 satisfies property A Input a positive integer number to check if it satisfies property A: 123 The number 123 does not satisfy property A Input a positive integer number to check if it satisfies property A: 4 The number 4 satisfies property A

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!