Question: Write a program in a file named SeedFinder. cpp that finds and displays all the seeds of an integer given by the user. Let's define
Write a program in a file named SeedFinder. cpp that finds and displays all the seeds of an integer given by the user. Let's define a seed of an integer, to be a
positive value that equals when multiplied by its individual digits. For example, is a seed of because is an example of a seed of itseli
because Many numbers have no seeds eg and some numbers have multiple seeds eg and are seeds of
Implement the following functions as parts of your overall solutions:
a getPositiveWholeNumber: This function asks the user for a positive whole number integer repeatedly until the input is correct. The number is then returned.
You can assume that the user will only input whole numbers, but you need to check if they are positive.
b checkIfSeed: This function takes two parameters: the number that may have seeds and a possible seed to check. The function returns a bool. The
function returns true if the possible seed is in fact a seed of the first parameter; otherwise, the function returns false. The function should first check if the
number is divisible by the possible seed; otherwise, it cannot be a seed and no further checks are necessary. If the number is dividable by the possible seed,
multiply the seed by each of its digits using a loop. Finally, compare that product with a number. Hint: use the modulus operator to extract the last digit of a
number and divide by to remove the last digit of a number.
This function should not get any input from the user or display any information ie do not use cin or cout in this function
C findAndDisplaySeeds: This is a void function that accepts a single integer as a parameter. The function should output "The seeds of are:" but
replacing N with the parameter's value After that, find and display each seed by looping through each possible seed value for the parameter and using
checkIfseed to see which values should be displayed. Output the word "none" if no seed values were found.
d The main function should simply display the header Seed Finder call getPositiveWholeNumber and then findAndDisplaySeeds Also, it
may define any variables that are necessary.
Make sure your program's output matches the format of the example output.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
