Question: Please write in c++ PART 4: One more One (www.projecteuler.net) (25 points) (www.projecteuler.net) Consider the following process that can be applied recursively to any positive

 Please write in c++ PART 4: One more One (www.projecteuler.net) (25

Please write in c++

PART 4: One more One (www.projecteuler.net) (25 points) (www.projecteuler.net) Consider the following process that can be applied recursively to any positive integer n: if n=1, do nothing and the process stops, if n is divisible by 7, divide it by 7, otherwise add 1. . The write a console program that constantly takes in a number n from the console and outputs to the console the number of 1's that must be added to the positive integer n before the process above ends. Make sure that your code detects numbers entered that are less than or equal to 0. All your source code for this part needs to be a file called lab1part4.cc Sample Sequence: +1 +7 +1 +1 +1 +7 +1 +1 +1 +1 +7 125 126 7 18 19 20 21+354 56+731 Example Input/Output: Please enter the starting number n: 125 The sequence had 8 instances of the number 1 being added Please enter the starting number n: 0 Invalid entry the number must be greater than 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!