Which Loop?
Write code segments to solve each of the following problems. Choose the loop that you feel is most natural: for, while, or do-while.
a. On April 1, Sally Saver deposits one cent in her piggy bank. As an April Fools Day resolution, Sally decides to double the previous day’s amount each day for one month. So, on April 2, Sally saves two cents; on April 3, four cents, and so on. How much will Sally have saved by April 30?
b. On April 1, Sally Saver deposits one cent in her piggy bank. Each day she doubles the amount from the previous day. When will Sally have saved $1,000,000?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.