Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Everythings Splendid (!) The electricy in your area went off and you (of course) were planning to do your math homework at the last minute.

Everythings Splendid (!) The electricy in your area went off and you (of course) were planning to do your math homework at the last minute. Your homework was simple: To write down a couple of perfect numbers and memorize them before class tomorrow. But since you dont have any internet connection, you cannot look them up. Lucky you, you have Spyder installed on your computer, battery that would last for a couple of hours, and no need for internet connection since Spyder can be used locally on your computer. You think you can write a program that checks whether a number is a perfect number or not. By definition in number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 is a perfect number: 1, 2, 3, and 6 are all divisible by 6. We add all numbers except the number itself (1+2+3) and if that equals to 6, which it does, we have a perfect number! Lets look at another number: 10. 10 can be divided by 1, 2, 5, and itself. We add all numbers except itself and it equals to 8, which is not the number we put to the test; so, 10 is not a perfect number. Your program should allow the user to enter any positive whole number (You dont need to check if its positive or if its an integer, assume the user always enters a positive integer) and then print out a message stating whether the number is a perfect number.

image text in transcribed

image text in transcribed

Please enter a number to check if it's a perfect number: 188819 The number is not a perfect number Please enter a number to check if it's a perfect number: 33558336 The number is a perfect number

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions