ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

Your mission is to write a program that examines positive integers within a range that the user specifies and categorizes them as follows:

by | Nov 28, 2023 | engineering

Your mission is to write a program that examines positive integers within a range that the user specifies and categorizes them as follows:ODD or EVENPRIME or COMPOSITE — a prime number is an integer greater than one that is divisible only by itself and one. Any number that is not “prime” is “composite”. 1 is neither prime nor composite by definitionPERFECT / ABUNDANT / DEFICIENT — as described aboveSQUARE — as described aboveTRIANGULAR — as described aboveYou may assume that the user, a.k.a. your grader, will enter integers for this program.The results are to be printed out in a well-formatted table. See the sample run below.ImplementationYour program MUST include the following functions.Do NOT change the function names or parameters in the function headers given below.Since this is a math-related project it’s appropriate for us to use n as a variable name for an integer. When a variable is holding the value of something, it’s important to name that variable with a meaningful name for what’s being held, but just an integer, is okay to be called n. Similarly, it’s okay to use a and bYou may choose to use more functions if you wish, but these are sufficient. All predicate functions, by definition, must return True or False. You have some flexibility in implementing the other functions.view sourceprint?def main():# is the skeleton of the programdef printGreeting():# explains the program to the userdef printTableHeading():# prints the heading of the tabledef isOdd(n):# a predicate function that returns True if n is odd# and returns False if not.def isPrime(n):# a predicate function that returns True if n is prime,#and False if notdef checkForPerfect(n):# classifies n as “perfect”, “abundant” or “deficient”. # A different value is returned for each category.def sumDivisors(n):# returns the sum of the divisors of n.def isDivisor(a, b):# a predicate function that returns True if b is# a divisor of a, and False if not.def isSquare(n):# returns True if n is a perfect square, False if not.def isTriangular(n):# returns True if n is a triangular number, False if not.def printTableLine(n, odd, prime, perfect, square, triangular):# prints the information for one number on one line of the table.output should look like thisThis program classifies positive integers asOdd/Even, Prime/Composite, Perfect/Abundant/Deficient,Square, and TriangularYou will now get to choose the range of positive integers thatyou would like to see classified.Start with which positive integer ?Please enter an integer between 1 and 100000 : 1End with which positive integer ?Please enter an integer between 1 and 100000 : 30Classifications………………………………———————————————————————–TriangularDeficientTriangularDeficientTriangularDeficientDeficientSquareTriangularDeficientAbundantDeficientDeficientTriangularSquareDeficientAbundantDeficientAbundantTriangularDeficientDeficientAbundantSquareDeficientDeficientTriangularDeficientAbundant

ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!

Open chat
1
Scan the code
ScholarMatic
Hello! Welcome to to our WhatsApp support.
We offer READY solutions, HIGH QUALITY PLAGIARISM FREE essays and term-papers.

We are online and ready to help