Question: Instruction: Write a Java program that reads a positive, non-zero integer as input and checks if the integer is deficient, perfect, or abundant. A positive,

Instruction: Write a Java program that reads a positive, non-zero integer as input and checks if the integer is deficient, perfect, or abundant. A positive, non-zero integer, N. is said to be perfect if the sum of its positive proper divisors fi.e., the positive integers, other than Nitself, that divide N exactly) is equal to the number itself. If this sum is less than N, the number is said to be deficient. If the sum is greater than N, the number is said to be abundant. The first few perfect numbers are 6, 28, 496, and 8128. Illustrations: Number Factors of the number less than itself Sum of Factors 6 3, 2, 1 6 28 14.7.4.2.1 28 For example, the number 6 is perfect since 6 = 1 + 2 + 3, the number 8 is deficient, since 8> 1 + 2 + 4, while the number 12 is abundant, since 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
