The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Course: 91
Please help me, i am stuck and my program wont run properly. Thank you.
Prog 1:
Multiplying the digits of an integer and continuing the process gives the surprising result that the sequence of products always arrives at a single digit number. For example,
715 ---- 35 ---- 15 ---- 5 27 ---- 14 ---- 4
4000 ---- 0
9
Course: 91
The number of times products need to be calculated to reach a single digit is called the persistence number of that integer. Thus, the persistence number of 715 is 3, the persistence number of 27 is 2, the persistence number of 4000 is 1, and the persistence number of 9 is 0. write a program that will continually prompt the user to enter a positive integer until EOF has been entered via the keyboard. For each number entered, your program should call a persistence function.
Â
Prog 2:
Redo the previous program but make it a recursive solution. Your recursive persistence function should have only a single argument. Re-use the same main function implemented in the previous programming exercise.
Â
Â
Â
Course: 91