Question: Write a Java program ( called ETest 6 ) which reads in any two integers and reports the results of three computations performed by the

Write a Java program (called ETest6) which reads in any two integers and reports the results of three computations performed by the methods listed below. You must call the three other functions from main() and must use (and printout) their returned results within main. You must produce input and output in the precise form shown below (in the Example interaction) and you must write and use the following public static functions as part of your solution:
void main( String[] args) which reads in two numbers, and calls the other three functions to determine the results to print out. This function must use the values which are returned by the other functions and must be the only function to print anything.
int sumOfCommonDivisors( int number1, int number2) which returns the sum of all whole positive numbers which divide evenly into both number 1 and number2.
e.g. if passed 96 and 36 it will return 28(which is 1+2+3+4+6+12).
int highestDigits(int number1, int number2) which returns a positive number where each digit in this number is the larger of corresponding individual digits in the two passed numbers
e.g. if passed 12383 and -5179 it will return 15389.
int[] getSquaresBetween(int number1, int number2) returns an array of integers each of which is the square of any other integer and which lies between number1 and number 2 inclusive. The numbers in the array should be listed from lowest to highest.
e.g. if passed 15 and 40 it will return an array containing the numbers 16,25,36
e.g. if passed 18 and -24 it will return an array containing the numbers 0,1,4,9,16
Example interaction (4 separate test runs):
Enter any two integers>
1640
15: The sum of the common divisors of 16 and 40
46: The 'highest digits' of 16 and 40
16,25,36: The squares between 16 and 40
Enter any two integers>
18-24
12: The sum of the common divisors of 18 and -24
28: The 'highest digits' of 18 and -24
0,1,4,9,16 : The squares between 18 and -24
Enter any two integers>
2417
1: The sum of the common divisors of 24 and 17
27: The 'highest digits' of 24 and 17
There are no squares between 24 and 17
Enter any two integers>
19 awf
Error in input. You needed to supply integer values.
Write a Java program ( called ETest 6 ) which

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 Programming Questions!