Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 Explanation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

Briefly explain the concept of corporate governance.

Answered: 1 week ago