Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program that accepts a positive integer greater than zero from the keyboard. The program then calls the following functions : 1.

Write a Python program that accepts a positive integer greater than zero from the keyboard. The program then 4. sumOfDigits (int number): A function that accepts the integer value that is entered from the keyboard and Program Run-1: Number Manipulations Enter a Positive integer Number > 0 Currency Calculation 19 cent/s is Sum of its digits for the integer 19 10 The sequence of distinct numbers starting at 58 29 88 44 22 11 34 17

Write a Python program that accepts a positive integer greater than zero from the keyboard. The program then calls the following functions : 1. currency Calculation (int number): Assuming that the number represent number of pennies, The function computes the number of quarters, dims, nickels, and pennies to be displayed. Displaying as many quarters as possible, then dims, then nickels, and pennies in that order. 2. personAge (int number): Assuming that the number represents a person's age. The function then calculates and displays statistics about the age. Assuming that there are 365 days in a year, The program displays the following information : - Number of months, numbers of days, number of hours, number of minutes, and number of seconds for the person. 3. numberSeparation (int number): Function should separate the numbers into its individual digits and displays on an screen the digits separated from one another by three spaces each. The function then displays each digit of the integer in English. For example, if the number is 42339, the output should be: 4 2 3 39. Four Two Three Three Nine 4. sumOfDigits (int number): A function that accepts the integer value that is entered from the keyboard and sums it digits. The function returns the sum back to the caller. 5. distinctSequence (int number): Given any positive integer n, the distinct sequence starting at n is obtained as follows. You write a sequence of numbers, one after another. Start by writing n. If n is even, then the next number is n/2. If n is odd, then the next number is 3n + 1. Continue in this way until you write the number 1. For example, The distinct sequence starting at 7 is (7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), and it contains 17 numbers. The distinct sequence starting at 6 is (6, 3, 10, 5, 16, 8, 4, 2, 1), and the distinct sequence starting at 1 is (1). Program Run-1: Number Manipulations Enter a Positive integer Number > 0 Currency Calculation 19 cent/s is equivalent to: 0 TTTO 1 1 4 quarter/s dime/s nickel/s cent/s Age Calculation Assuming that you are 19 year's old, then You are 228 months old You are 6935 days old You are approximately 166440 hours old You are approximately 9986400 minutes old You are approximately 599184000 seconds old Separating digits for the integer 19 one nine. 19 19 Sum of its digits for the integer 19 10 The sequence of distinct numbers starting at 58 29 88 44 22 11 34 17 52 26 40 20 10 5 16 8 4 2 1 Implemented by Husain Gholoom April 29th, 2020 Program Run-2 Number Manipulations Enter a Positive integer Number > 0 ---> invalid input -1 *** Error re-run the app & use a positive number> 0 111 -1 19 is 13

Step by Step Solution

3.47 Rating (163 Votes )

There are 3 Steps involved in it

Step: 1

Below is the Python program that fulfills the given requirements def currencycalculationnumber quart... 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

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

Students also viewed these Programming questions

Question

What are the modules of C++ programs called?

Answered: 1 week ago