Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Homework NoEffort
So, here is the problem:
 
Suppose m and n are integers and m is nonozero. Recall that m is called a divisor of n if n = mt for some integer t; that is, when m divides n, the remainder is 0. Moreover, m is called a proper divisor of n if m < n and m divides n. A positive integer is called perfect if it is the sum of its positive proper divisors. For example, the positive proper divisiors of 28 are 1, 2, 4, 7, and 14 and 1 + 2 + 4 + 7 + 14 = 28. Therefore, 28 is a perfect. Write a program that do the following:
 
a. Output the first four perfect numbers
b. Input a positive integer number and determine whether the integer is perfect. Validate the input. Ask the user to enter another input until the user enters 0.
 
You are required to implement the following function:
 
bool sumOfAllProperDivisors (int m)
The function returns true if the sum of positive proper divisors of number m is equal to m;otherwise, it returns false.
 
You NEED to use bool sumOfAllProperDivisors. How can we make this program work?
Posted 15-Oct-12 5:09am
Edited 15-Oct-12 5:13am
Wes Aday94.3K
v3
Comments
Wes Aday at 15-Oct-12 10:13am
   
First: this is not a problem. This is homework. Second: How do you make this program work? By writing some code. Pay attention in class. Read your textbook.
Sergey Alexandrovich Kryukov at 15-Oct-12 15:00pm
   
This is the answer. Even though there is no a question.
--SA
geekbond at 15-Oct-12 10:29am
   
Oh, sorry. CP does not answer homework. Listen in class and atleast you could've written some of what you've tried and we'll be happy to point you in the right direction.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Why do we not do your homework. (Compliments of JSOP)[^]
 
This is not a difficult problem. The logic required is clearly laid out for you in your question text. I would suggest you break down the question into its smaller components and solve each component separately. Then tie the components together into your final solution.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 299
2 BillWoodruff 174
3 /\jmot 170
4 Suraj Sahoo | Coding Passion 150
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 15 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100