Alright guys i got another one:
In the class Mymath, create a public method called calculateFactor. The method has two two arguments of type integer and checks whether the smaller of the two integers is a factor of the larger of the two integers. The method will return a factor or a zero.
Write a main method which reads in a positive integer n and displays out the largest proper divisor of n (that is, the largest factor of n that is less than n itself).
Sample output:
Input an integer number:
124
Largest divisor: 62
Another input (y/n)?
y
Input an integer number:
18
Largest divisor: 9
Sample Run:
6
28
496
Im having alot of trouble with this one. Please Help.