In C programming!! Function prototype and implementation for the calculateDivisors function that takes in an integer parameter, calculates the sum of its divisors, and returns that sum (as an integer value) A structure that represents what is represented on each line of output, e.g., o Linenumber o Sumofthedivisorsforthatlinenumber o Characterarraycontaining“Perfect”,“Deficient”,or“Abundant” Pointer declared within the main that will be used to point to an area of memory containing a collection of these structs Dynamically allocated memory for the number of structs necessary You will assign values to each struct via the pointer A loop that goes from X to Y, where X and Y are the numbers inputted by the user at the command line argument o Note:becausetheuserisenteringinputhere,youwillneedtocheckforreasonableness: § The value of X must be greater than or equal to 2 § The value of Y must be greater than the value of X § If either one of the above conditions are not met, you should display an error and re- prompt. The user also specifies the character used for the histogram, which is simply the sum of divisors excluding the original number. The line number column uses a column width of 4; the status of divisors is in a column of width 10.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In C programming!!

  • Function prototype and implementation for the calculateDivisors function that takes in an

    integer parameter, calculates the sum of its divisors, and returns that sum (as an integer value)

  • A structure that represents what is represented on each line of output, e.g.,

    o Linenumber
    o Sumofthedivisorsforthatlinenumber
    o Characterarraycontaining“Perfect”,“Deficient”,or“Abundant”

  • Pointer declared within the main that will be used to point to an area of memory containing a collection of these structs

  • Dynamically allocated memory for the number of structs necessary

  • You will assign values to each struct via the pointer

  • A loop that goes from X to Y, where X and Y are the numbers inputted by the user at the command line

    argument
    o Note:becausetheuserisenteringinputhere,youwillneedtocheckforreasonableness:

    § The value of X must be greater than or equal to 2
    § The value of Y must be greater than the value of X
    § If either one of the above conditions are not met, you should display an error and re-

    prompt.

  • The user also specifies the character used for the histogram, which is simply the sum of divisors

    excluding the original number.

  • The line number column uses a column width of 4; the status of divisors is in a column of width 10.

./a.out 15 19 '|'
15 is Deficient
16 is Deficient
17 is Deficient
18 is Abundant
19 is Deficient
||
NOTE: the tick (') mark is needed around the | because the | is used in Linux
to pipe output of one program into another program.
./a.out
19 15 '|'
Sorry, the first value must be less than the second.
Please enter the lower value: 15
Please enter the upper value: 19
15 is Deficient
16 is Deficient
|I||
17 is Deficient
18 is Abundant
19 is Deficient
Transcribed Image Text:./a.out 15 19 '|' 15 is Deficient 16 is Deficient 17 is Deficient 18 is Abundant 19 is Deficient || NOTE: the tick (') mark is needed around the | because the | is used in Linux to pipe output of one program into another program. ./a.out 19 15 '|' Sorry, the first value must be less than the second. Please enter the lower value: 15 Please enter the upper value: 19 15 is Deficient 16 is Deficient |I|| 17 is Deficient 18 is Abundant 19 is Deficient
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education