Write a function that will read one integer from the command prompt. Your second function will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function that will read one integer from the command prompt. Your second function will decide whether the entered number is Perfect Number and Harmonic Divisor Number. The input must be a natural number. Perfect Number is the number at which the sum of all natural number divisor of a natural number n is equal to itself. (1 included, not including itself). Harmonic Divisor Number or Ore Number is a positive integer whose divisors have a harmonic mean that is an integer. Let the function continue working until it gets the input then end the program. Function prototype is void decide_perfect_harmonic_number() Example: Please enter input number: 6 Natural Number Divisors: 1, 2, 3, 6 Is Perfect Number? : Yes Hint: 1+2+3 = 6 and input 6. That's why it's the perfect number. Is Harmonic Divisor Number?: Yes Hint: Number 6 has the four divisors. Their harmonic mean is an integer: 4/ ((1/1)+ (1/2) + (1/3) + (1/6)) = 2 Please enter input number: 28 Natural Number Divisors: 1, 2, 4, 7, 14, 28 Is Perfect Number? : Yes Hint: 1+2+4+7+ 14 = 28 and input 28. That's why it's the perfect number. Is Harmonic Divisor Number?: Yes Hint: Number 28 has the six divisors. Their harmonic mean is an integer: 6/((1/1)+ (1/2) + (1/4) + (1/7) + (1/14) + (1/28) = 2 Please enter input number: 15 Natural Number Divisors: 1, 3, 5, 15 Hint: 1+ 3 + 5 = 9 but input 15. That's why it's not the perfect number. Is Perfect Number? : No Is Harmonic Divisor Number? : No Hint: Number 15 has the four divisors. Their harmonic mean is not an integer: 4 / ((1/1) + (1/3) + (1/5) + (1/15)) = 1.6 Write a function that will read one integer from the command prompt. Your second function will decide whether the entered number is Perfect Number and Harmonic Divisor Number. The input must be a natural number. Perfect Number is the number at which the sum of all natural number divisor of a natural number n is equal to itself. (1 included, not including itself). Harmonic Divisor Number or Ore Number is a positive integer whose divisors have a harmonic mean that is an integer. Let the function continue working until it gets the input then end the program. Function prototype is void decide_perfect_harmonic_number() Example: Please enter input number: 6 Natural Number Divisors: 1, 2, 3, 6 Is Perfect Number? : Yes Hint: 1+2+3 = 6 and input 6. That's why it's the perfect number. Is Harmonic Divisor Number?: Yes Hint: Number 6 has the four divisors. Their harmonic mean is an integer: 4/ ((1/1)+ (1/2) + (1/3) + (1/6)) = 2 Please enter input number: 28 Natural Number Divisors: 1, 2, 4, 7, 14, 28 Is Perfect Number? : Yes Hint: 1+2+4+7+ 14 = 28 and input 28. That's why it's the perfect number. Is Harmonic Divisor Number?: Yes Hint: Number 28 has the six divisors. Their harmonic mean is an integer: 6/((1/1)+ (1/2) + (1/4) + (1/7) + (1/14) + (1/28) = 2 Please enter input number: 15 Natural Number Divisors: 1, 3, 5, 15 Hint: 1+ 3 + 5 = 9 but input 15. That's why it's not the perfect number. Is Perfect Number? : No Is Harmonic Divisor Number? : No Hint: Number 15 has the four divisors. Their harmonic mean is not an integer: 4 / ((1/1) + (1/3) + (1/5) + (1/15)) = 1.6
Expert Answer:
Answer rating: 100% (QA)
The following pseudocode shows a function that will read one integer from the command prompt and det... View the full answer
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date:
Students also viewed these computer network questions
-
On 1 April 2 0 X 3 , Warminster entered into a lease agreement. The payment terms comprise $ 6 0 , 0 0 0 payable on 1 April 2 0 X 3 followed by three further payments of $ 6 0 , 0 0 0 payable on 3 1...
-
Create the game: Mancala Setup Players sit on either side of the board. Each player has six bowlsand one mancala. Before play begins, four stones are placed intoeach bowl, while both mancalas are...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Picasso Co. issued 5,000 shares of its $1 par common stock, valued at $100,000, to acquire shares of Seurat Company in an all-stock transaction. Picasso paid the investment bankers $35,000 and will...
-
Asteroids have been moving through space for billions of years. What keeps them moving?
-
Consider again the one-way ANOVA hypothesis test described in Problem 29. Suppose now that the professional golf association wants to compare the mean distances traveled by four brands of golf balls...
-
Six different settings are tried on a machine to determine whether any of them will reduce the proportion of defective parts. For each setting, an appropriate null hypothesis is tested to determine...
-
A Carnot cycle uses 1.00 mol of a monatomic perfect gas as the working substance from an initial state of 10.0 atm and 600 K. It expands isothermally to a pressure of 1.00 atm (Step 1), and then...
-
Suppose a stock had a value of $28.23 per share at the end of 2007. And suppose the stock paid $2 in dividends at the end of 2008 and $2.25 at the end of 2009. If the stock's value is $30 at the end...
-
The Harvey City Comprehensive Case consists of the last problem in each chapter from Chapters 4 through 15. Completing this case essentially requires that you account for all the transactions of a...
-
Consider the 2D flow illustrated below. Its velocity is given by y = x + y U v = -x x + y 7 the streamlines are circles centered at the origin (0,0), and this type of flow is know as a point vortex...
-
A single-phase step-down transformer is rated \(13 \mathrm{MVA}, 66 \mathrm{kV} / 11.5 \mathrm{kV}\). With the \(11.5 \mathrm{kV}\) winding short-circuited, rated current flows when the voltage...
-
If Doria Oliva dies this year (2019), what estate tax is payable if the facts are: Adjusted gross estate Adjusted taxable gifts after 1976 Cift tax paid $11,710,000 100,000 6,000
-
A single-phase 100-kVA, 2400/240-volt, 60-Hz distribution transformer is used as a step-down transformer. The load, which is connected to the 240 -volt secondary winding, absorbs \(60 \mathrm{kVA}\)...
-
An S corporation has the following information: Compute the S$ corporation's taxable income for the year. Sales Dividend income Tax-exempt interest Long-term capital gain Short-term capital gain Cost...
-
For a single-phase two-conductor line with composite conductors \(x\) and \(y\), express the inductance of conductor \(x\) in terms of GMD and its GMR.
-
Find the number of ways of selecting a cricket team of 11 players from 7 batsmen Cricket team of 11 players from 7 batsmen and 6 bowlers such that there will be atleast 5 bowlers in the team
-
Explain what is meant by vicarious liability and when it is available?
-
Relate that this organization was originally known as the Information Systems Audit and Control Association. ISACA is a professional association that focuses on auditing, control, and security. The...
-
Review the concepts of technology governance and change controls and how they apply to a project plan: Technology governance are the policies in place that determine how often technical systems are...
-
True or False: The cornerstone of many current federal computer-related criminal laws is the Computer Fraud and Abuse Act of 1986.
-
Your medical terminology instructor listed the following grades for the class out of a 75-point test: 34, 36, 41 , 43, 44,49,50, 55,57, 60,64, 66, 67,67, 67,68,68,69, 70, 73 a. Find the 90th...
-
From the following list of number of discharges each day in September, compute the mean, median, mode, and range. Round the mean and median to one decimal point. University Hospital Number of...
-
Use the following information to compute the ALOS and median LOS and range for Community Nursing Center. The discharge date is June 2, 20XX (a non-leap year). Round the ALOS to one decimal place....
Study smarter with the SolutionInn App