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...


Instruction:<br>Write a Java program that reads a positive, non zero integer as input and checks if the<br>integer is deficient, perfect, or abundant.<br>A positive, non-zero integer, N, is said to be perfect it the sum of its positive proper divisors<br>(i.e., the positive integers, other than N itself, that divide N exactly) is equal to the number<br>itself. If this sum is less than N, the number is said to be deficient. It the sum is greater than<br>N, the number is said to be abundant.<br>The first few perfect numbers are 6, 28, 496, and 8128.<br>| Illustrations:<br>Number<br>6.<br>28<br>For example, the number 6 is perfect, since 6 = 1 + 2 + 3, the number 8 is deficient, since<br>8>1 + 2+ 4, while the nurmber 12 is abundant, since 12<1+2+3+4+ 6.<br>| Factors of the number less than itself | Sum of Factors<br>3. 2. 1<br>14, 7, 4, 2, 1<br>6.<br>28<br>Sample Input/Output:<br>Depicled below are sample oulputs when the program is execuled (Ihe ilems in bold<br>characters are input from the user, while the items in bold italic are calculated and<br>printed by the program):<br>Input N: 5<br>Input N: 6<br>6 Is perfect.<br>Input N: 18<br>5 is deficient.<br>18 is abundant.<br>Required: The java file (FamilyName_Perfect.java) containing the code and 3 image files<br>(Sample1, Sample2 and Sample3) containing different sample input/output of the<br>program.<br>

Extracted text: 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 it the sum of its positive proper divisors (i.e., the positive integers, other than N itself, that divide N exactly) is equal to the number itself. If this sum is less than N, the number is said to be deficient. It 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 6. 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 nurmber 12 is abundant, since 12<1+2+3+4+ 6.="" |="" factors="" of="" the="" number="" less="" than="" itself="" |="" sum="" of="" factors="" 3.="" 2.="" 1="" 14,="" 7,="" 4,="" 2,="" 1="" 6.="" 28="" sample="" input/output:="" depicled="" below="" are="" sample="" oulputs="" when="" the="" program="" is="" execuled="" (ihe="" ilems="" in="" bold="" characters="" are="" input="" from="" the="" user,="" while="" the="" items="" in="" bold="" italic="" are="" calculated="" and="" printed="" by="" the="" program):="" input="" n:="" 5="" input="" n:="" 6="" 6="" is="" perfect.="" input="" n:="" 18="" 5="" is="" deficient.="" 18="" is="" abundant.="" required:="" the="" java="" file="" (familyname_perfect.java)="" containing="" the="" code="" and="" 3="" image="" files="" (sample1,="" sample2="" and="" sample3)="" containing="" different="" sample="" input/output="" of="" the="">

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here