473,396 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Needing help solving practice test problem

I'm a student whose taking comp 110, and my professor gave the class a practice exam to help us study for our exam on tuesday.
The question is:

A perfect number is a positive integer that is equal to the sum of its proper divisors. A proper divisor is a positive integer other than the number itself that divides the number evenly (i.e., no remainder).

For example, six is a perfect number because the sum of its proper divisors 1,2, and 3 is equal to 6. Eight is not a perfect number, because 1+2+4 doesn not add up to eight. Write a Java Method, public static boolean Perfect (int n), to return true if n is a perfect number and false, otherwise.

Use the function to print all perfect numbers from the interval [6, 500]

Thanks so much to whoever solves this. Something very similar may appear on my exam this tuesday. I'd like to study the solution.
Nov 3 '07 #1
0 969

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: J | last post by:
Dear Advanced users, Here are parts of a code sample and I need to find out a few things from this. Please tell me your input. I am supposed to get others help as well to make the answers as...
0
by: Sri | last post by:
I would like some suggestion for practice test for 70-228? If any of you have expereince in the exam 70-228 -- what will be the best self practice test that I can take to gauge my skill before the...
2
by: thx606 | last post by:
Hello, I'm having some trouble with my code below. One of my If statements causes the code not to work. If I take the If Statement out it runs fine. I highlighted the area that I'm having...
16
by: Martin Jørgensen | last post by:
Hi, I've made a program from numerical recipes. Looks like I'm not allowed to distribute the source code from numerical recipes but it shouldn't even be necessary to do that. My problem is...
1
by: bparanj | last post by:
Hello, I have been a software developer for the past 10 years now. I get job descriptions that requires problem-solving skills as one of the most desirable skills in a candidate. But there are...
1
by: bparanj | last post by:
Hello, I have been a software developer for the past 10 years now. I get job descriptions that requires problem-solving skills as one of the most desirable skills in a candidate. But there are...
9
by: TG | last post by:
Hi there. Anyone knows how to use numpy / scipy in order to solve this ? * A is an array of shape (n,) * X is a positive float number * B is an array of shape (n,) * O is an array of shape...
3
by: Alan Isaac | last post by:
This is a simple question about actual practice. I just want to know how you (yes you) are approaching this problem. The problem: What is the recommended packaging of demo scripts or test...
20
by: @$|-|. DUBEY | last post by:
i have a interger val = 99999; and i want to add the content of val i.e., 9+9+9+9+9 = 45; how to do that.... need urgent help
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.