Write a program in Java to compute the super-digit of a given integer. The super-digit of an integer is the one-digit number which is the sum of the digits in that number.
For example, the super-digit of 9875 will be calculated as:
super-digit(9875) = super-digit(9+8+7+5)
super-digit(29)
super-digit(2+9)
super-digit(11)
= super-digit(1+1)
super-digit(2+2)
The number should be taken from the user. If the number is less than 10, the program should throw an exception.
Input an integer, followed by a newline.
Output a super-digit number, followed by a newline.