Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA 18. Perfect Number Write a Java program that takes two integer numbers, which are X and Y. Then, your program should find and output
JAVA
18. Perfect Number Write a Java program that takes two integer numbers, which are X and Y. Then, your program should find and output whether these numbers and the addition of these numbers is a perfect number. A perfect number is a number whose sum of the divisors is two times bigger than the number. Example: 28 divisors (1,2,4,7,14,28) 1+2+4+7+14+28=5656=282 ( 28 is a perfect number) Input Format For Custom Testing Sample Case 0 Sample Input For Custom Testing 6 28 Sample Output Enter number 1: 6 Enter number 2: 28 Number 1 is a perfect number Number 2 is a perfect number Their addition 34 is not a perfect number Explanation Sample Case 1 Sample Input For Custom Testing 8128 5 Sample Output Enter number 1: 8128 Enter number 2: 5 Number 1 is a perfect number Number 2 is not a perfect number Their addition 8133 is not a perfect number ExplanationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started