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.

Respuesta :

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.