Ask Question
28 November, 12:47

Write code to complete doublepennies () 's base case. sample output for below program: number of pennies after 10 days: 1024 note: these activities may test code with different test values. this activity will perform three tests, with startingpennies = 1 and userdays = 10, then with startingpennies = 1 and userdays = 40, then with startingpennies = 1 and userdays = 1. see "how to use zybooks". also note: if the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.

+2
Answers (1)
  1. 28 November, 15:54
    0
    Int resultPennies = startingPennies;

    for (int i = 0; i < userDays; i++) {

    resultPennies * = 2;

    }

    return resultPennies;

    The above code should do. You will need to adapt this code to your desired language, as you never specified a language.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write code to complete doublepennies () 's base case. sample output for below program: number of pennies after 10 days: 1024 note: these ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers