Question: Write a program in a file named SeedFinder.cpp that finds and displays all the seeds of a 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 a 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 a integer given by the user. Let's define a seed of an integer, n, to be a positive value that equals n when multiplied by its individual digits. For example, 23 is a seed of 138 because 23 x 2 x 3= 138. 111 is an example of a seed of itself because 111x1x1x1=111 Many numbers have no seeds (e.g. 2) and some numbers have multiple seeds (eg, 24 and 32 are seeds of 1921 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: (1) the number with possible seeds and [2] 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, multiple the seed by each of its digits using a loop. Finally, compare that product with number. Hint: use the modulus operator to extract the last digit of a number and divide by 10 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 seed(s) of N 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 programs output matches the format of the example output Sample Output (user input is in yellow) Seed Finder --- Enter a positive whole number: -1 Enter a positive whole number: Enter a positive whole number: 24 lie, do not use cin or cout this function) c. findAndDisplayseeds: This is a void function that accepts a single integer as a parameter. The function should output "The seed(s) of N 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 get PositivewholeNumber (). and then findAndDisplaySeeds (). Also, it may define any variables that are necessary. Make sure your programs output matches the format of the example output Sample Output (user input is in yellow) Seed Finder Enter a positive whole number: -1 Enter a positive whole number: Enter a positive whole number: 24 The seed(s) of 24 are: 12. Sample Output (user input is in yellow) Seed Finder Enter a positive whole number: 289 The seed(s) of 289 are: none. Sample Output (user input is in yellow) Seed Finder Enter a positive whole number: 549584 The seed(s) of 549584 are: 1696 2862 3392 3816. Write a program in a file named SeedFinder.cpp that finds and displays all the seeds of a integer given by the user. Let's define a seed of an integer, n, to be a positive value that equals n when multiplied by its individual digits. For example, 23 is a seed of 138 because 23 x 2 x 3= 138. 111 is an example of a seed of itself because 111x1x1x1=111 Many numbers have no seeds (e.g. 2) and some numbers have multiple seeds (eg, 24 and 32 are seeds of 1921 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: (1) the number with possible seeds and [2] 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, multiple the seed by each of its digits using a loop. Finally, compare that product with number. Hint: use the modulus operator to extract the last digit of a number and divide by 10 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 seed(s) of N 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 programs output matches the format of the example output Sample Output (user input is in yellow) Seed Finder --- Enter a positive whole number: -1 Enter a positive whole number: Enter a positive whole number: 24 lie, do not use cin or cout this function) c. findAndDisplayseeds: This is a void function that accepts a single integer as a parameter. The function should output "The seed(s) of N 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 get PositivewholeNumber (). and then findAndDisplaySeeds (). Also, it may define any variables that are necessary. Make sure your programs output matches the format of the example output Sample Output (user input is in yellow) Seed Finder Enter a positive whole number: -1 Enter a positive whole number: Enter a positive whole number: 24 The seed(s) of 24 are: 12. Sample Output (user input is in yellow) Seed Finder Enter a positive whole number: 289 The seed(s) of 289 are: none. Sample Output (user input is in yellow) Seed Finder Enter a positive whole number: 549584 The seed(s) of 549584 are: 1696 2862 3392 3816.

Step by Step Solution

3.43 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Debug SeedFindercpp 1 2 3 4 int getpositivewholenumber 5 6 7 8 9 10 11 12 13 HAHAAANNNNN2 14 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!