UESTION 31 ot yet answered arked out of 1.00 A perfect pair of integers are those...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
UESTION 31 ot yet answered arked out of 1.00 A perfect pair of integers are those where the sum of the double of each multiple of the first number except the numbers themselves, is a multiple of 10. For example, consider the integers 2 and 8, where the multiples of 2 between 2 and 8 are 2, 4, 6, and 8. The double of each multiple excluding the numbers themselves are 8 and 12. - 81220 which is a multiple of 10 Therefore the integers 2 and 8 (in that order) is a perfect pair as the sum of the double of each multiple of the first number except the numbers themselves, is a multiple of 10. You will write some code that will classify a pair of integers as "Perfect Pair" or Not Perfect Pair". For this question, you do not need to be concerned with error conditions unless specifically asked to do so. ANSWER THE FOLLOWING FOUR (4) QUESTIONS a., b., c., and d.: [ENTER THE ANSWERS IN THE BOX PROVIDED AFTER THE QUESTIONS] a. Write a function called isMultiple that accepts two positive integers. If the first integer divides the second integer with a remainder of 0, then isMultiple returns True, otherwise it returns False. [2 marks] e.g. >>> isMultiple (28,7) False >>> isMultiple (64,256) True b. Write a function called multipleList that accepts two integers. It steps through the full range of numbers between the first integer and second integer inclusive and returns the integer's multiples as a list. It must use the function isMultiple that was written in part a. above. e.g. >>> multipleList (64,256) [3 marks] C. [64, 128, 256] Write a function called doubleSumList that accepts a list of positive integers and [4 marks] d. e.g. >>> doubleSumList ([1, 2, 3, 4, 5]) 30 returns the sum of double each number. Write a procedure called perfectOrNot that accepts two positive integers and prints whether the integers are a perfect pair (sum of the double of each multiple except the numbers themselves, is a multiple of 10). It must use the functions multipleList and doubleSumList that were written in parts b. and c. above. e.g. >>> perfectOrNot (2, 14) Perfect Pair >>> perfectOrNot (2, 10) Not Perfect Pair [6 marks] [ENTER ANSWERS HERE] [The answer area for each question may be expanded as desired.] a. b. d. UESTION 31 ot yet answered arked out of 1.00 A perfect pair of integers are those where the sum of the double of each multiple of the first number except the numbers themselves, is a multiple of 10. For example, consider the integers 2 and 8, where the multiples of 2 between 2 and 8 are 2, 4, 6, and 8. The double of each multiple excluding the numbers themselves are 8 and 12. - 81220 which is a multiple of 10 Therefore the integers 2 and 8 (in that order) is a perfect pair as the sum of the double of each multiple of the first number except the numbers themselves, is a multiple of 10. You will write some code that will classify a pair of integers as "Perfect Pair" or Not Perfect Pair". For this question, you do not need to be concerned with error conditions unless specifically asked to do so. ANSWER THE FOLLOWING FOUR (4) QUESTIONS a., b., c., and d.: [ENTER THE ANSWERS IN THE BOX PROVIDED AFTER THE QUESTIONS] a. Write a function called isMultiple that accepts two positive integers. If the first integer divides the second integer with a remainder of 0, then isMultiple returns True, otherwise it returns False. [2 marks] e.g. >>> isMultiple (28,7) False >>> isMultiple (64,256) True b. Write a function called multipleList that accepts two integers. It steps through the full range of numbers between the first integer and second integer inclusive and returns the integer's multiples as a list. It must use the function isMultiple that was written in part a. above. e.g. >>> multipleList (64,256) [3 marks] C. [64, 128, 256] Write a function called doubleSumList that accepts a list of positive integers and [4 marks] d. e.g. >>> doubleSumList ([1, 2, 3, 4, 5]) 30 returns the sum of double each number. Write a procedure called perfectOrNot that accepts two positive integers and prints whether the integers are a perfect pair (sum of the double of each multiple except the numbers themselves, is a multiple of 10). It must use the functions multipleList and doubleSumList that were written in parts b. and c. above. e.g. >>> perfectOrNot (2, 14) Perfect Pair >>> perfectOrNot (2, 10) Not Perfect Pair [6 marks] [ENTER ANSWERS HERE] [The answer area for each question may be expanded as desired.] a. b. d.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
Make up a NEW company and make up the NEW product or service that they sell in Canada. 1) Conduct a short internal analysis (SWOT) 2) Conduct a short external analysis (PESTLE) 3) Based on numbers 1...
-
Portray in words what transforms you would have to make to your execution to some degree (a) to accomplish this and remark on the benefits and detriments of this thought.You are approached to compose...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
The inequality describes the range of monthly average temperatures T in degrees Fahrenheit at a certain location. (a) Solve the inequality. (b) If the high and low monthly average temperatures...
-
Economic globalization has many implications for business. It also has implications for employees. From your perspective, what are the three most significant implications of globalization for...
-
calculations the Pivot table Sector Task 3(a): Consumer Discretionary Materials Telecommunications Services Utilities Grand Total Average of Count of TransactionID Qty Average of UnitPrice Sum of...
-
To which work sheet column is the debit balance of Cost of Goods Sold extended?
-
How does one determine whether a particular lease is a capital lease or an operating lease? What entries are required in the general journals of a governmental fund and governmental activities at the...
-
The following tables summarize the 2022 income statement and end-year balance sheet of Drake's Bowling Alleys. Drake's financial manager forecasts a 15% increase in sales and costs in 2023. The ratio...
-
4. A survey of workers found that 4% work overtime. Select 92 workers at E random and ask if they work overtime. The binomial random variable X measures the number of positive answers. a) Can you...
-
Woolard Supplies (a sole proprietorship) has taxable income in 2020 of $240,000 before any depreciation deductions (179, bonus, or MACRS) and placed some office furniture into service during the...
-
An object is placed 74.5 cm from a screen. (a) Where should a converging lens of focal length 9.0 cm be placed to form a clear image on the screen? (Give your answer to at least one decimal place.)...
-
Completion 20. A(n) is an integrated circuit designed to process instructions. 21. Processors based on technology dominate tablet computers and smartphones. 22. processors are found in Microsoft's...
-
Chose a health care function to evaluate for efficiency and effectiveness of delivery. You will apply Lean Six Sigma principles by using the DMAIC methodology to present how errors and waste can be...
-
Presented below are selected transactions of Kingbird Company. Kingbird sells in large quantities to other companies and also sell product in a small retail outlet. March 1 Sold merchandise on...
-
The Diamonds have two teenage daughters. Last July they decided that given their financial resources they could not afford to have any more children and that their family is "complete". After some...
-
Akramin just graduated with a Master of Engineering in Manufacturing Engineering and landed a new job in Melaka with a starting salary of RM 4,000 per month. There are a number of things that he...
-
Perfectly competitive firms are _________, who must accept the market price as determined by the forces of demand and supply.
-
Consumers believe that all firms in a perfectly competitive market sell _________ products.
-
In all types of market environments, firms will maximize profits at that output that maximizes the difference between _________ and _________, which is the same output level where _________ equals...
Study smarter with the SolutionInn App