Ask Question
23 March, 04:56

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.

+3
Answers (1)
  1. 23 March, 06:16
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers