Answered step by step
Verified Expert Solution
Question
1 Approved Answer
code in c++ Assignment Overview This assignment will exercise your ability to utilize control statements for C++ to solve a math problem Background A perfect
code in c++
Assignment Overview This assignment will exercise your ability to utilize control statements for C++ to solve a math problem Background A perfect number is an integer whose sum of divisors, excluding the number itself, equals the number. They have been known since at least Euclid in 300 B.C.E, perhaps earlier. The 1st perfect number is 6 its divisors are 1, 2, 3 which, when summed together, equal 6. 28 is the next perfect number with the divisors 1, 2, 4,7, 14 which, summed together are 28. There are many variations on perfect numbers one of which we will work with for this project, k-hyperperfect numbers (see A k-hyperperfect number is a variation on perfect numbers with the following properties . . . We sum all the divisors excluding 1 and the number. We multiply the number by some factor k. We add 1 to the product. If the result is the number back again, the number is k-hyperperfect For example, 21 is a 2-hyperperfect number. The divisors are 1,3,7,21 but we ignore the 1 and 21. The sum of the remaining factors (3,7) is 10. Multiply by two and add 1, we get 21. The factors of 301 (ignoring 1 and 301) are 7, 43. ((7+43) * 6)+1-301, making 301 6-hyperperfect. 12211188308281 has the factors 211, 1231, 259741, 47012941, 9919730551, 57872930371. The sum of those is (67839935046 * 180)+1 equaling 12211188308281 making it 180-hyperperfect. Look at the table for more examples Project Description / Specification There are two types of test cases in Mimir. Tests where you can see the result (so you can correct your work if you get the incorrect) and those tests where you only get a Pass/Non-Pass answer without seeing the result, so called hidden cases. You will get a combination of both for all Mimir projects from now on. The reason is that we want you to write code that solves the problem according to the specifications, not just give the "correct" answers back as Mimir provides Warning: Nonetheless, it is possible to figure out the required answers even on a hidden test case. We require, however, that you write code to solve the problem, not just give back the correct answer. The TAs will check this during grading. The TAs are instructed to give a 0 for any test case that does not solve the problem but only gives back the Mimir required answer. e Two integers An integer to check if it is k-hyperperfect (if there exists a k that makes the provided integer k-hyperperfect) A max value of k (up to and including the max) that needs to be checked o oStep 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