logo CodeStepByStep logo

findKeithNumbers

Language/Type: C++ Vector collections
Author: Keith Schwarz (added by Marty Stepp on 2016/10/04)

Write a function named findKeithNumbers that accepts minimum and maximum integers as parameters and prints all of the "Keith numbers in that range (inclusive) in the format shown below. See previous program isKeithNumber to learn the definition of a "Keith number." If the given range contains no Keith numbers, print no output. For example, the call of findKeithNumbers(47, 742); would print the following output:

47: {4, 7, 11, 18, 29, 47}
61: {6, 1, 7, 8, 15, 23, 38, 61}
75: {7, 5, 12, 17, 29, 46, 75}
197: {1, 9, 7, 17, 33, 57, 107, 197}
742: {7, 4, 2, 13, 19, 34, 66, 119, 219, 404, 742}
Type your solution here:


This is a function problem. Write a C++ function as described. Do not write a complete program; just the function(s) above.

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.

© Marty Stepp, all rights reserved.