Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Instructions limportant This programming assignment is for ALL students, whether they use ryBooks or not. Develop your code as a standalone application, either in

image text in transcribed
image text in transcribed
1 Instructions limportant This programming assignment is for ALL students, whether they use ryBooks or not. Develop your code as a standalone application, either in the school lab, or at home. - Submit yoursource code on Moodle as follows: - For write your code in a file named a4perfectice - Please use file teaplate. ce (available on Moodle for this assignment) to start your code. - The problem is marked out of 10 points: 2 Programming problems P1: An integer p is callod a divisor G Gathothet integer n if p divides n. For example, 3 is a divisor of 6. All the divisons of 6 ame 1, 2, and 6. A divisot p of n is called proper if p=n. The proper divisors of 6 are 1,2* and 3. The only proper divisor of 5 is 1, and the proper divisors of 24 are 1 . 2, 3,4, 6, 8, and 12 An integer n is called deficient if the sum of its proper divisots is less than n. Example: 5 is deficient becouso 1 is less than 5 . An liteger n is called perfoct if the sum of its proper divisors is cqual to n. Example: 6 is perfoct becauso 1+2+3=6. Finally, an integer n is called abundant if the sum of its proper divisors is greater than n. Exaunple 24 is abundant because 1+2+3+4+6+8+12=36>24. Write a compater program that reads a single integer from input and determines whether the integer is deficient, perfect, or abundant as slown in the examples. Do not write any messuges before roading the input and do not. write aty other messages than what is shown in the output. Input: B2. Output: 62 in deficient Input: 13 Output: 13indeticient Input: 24 Output: 24isabubdant Input: 945 Output: 945inabundmat Input: 496 Output: 496:18 perfect

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

=+ Are there closed-shop requirements or practices?

Answered: 1 week ago