Question: need help with the following. need to write code to complete double pennys base case sample output: number of pennies after 10 days: 1024 code

need help with the following. need to write code to complete double pennys base case

sample output: number of pennies after 10 days: 1024

code so far is provided:

need help with the following. need to write code to complete double

main.cpp 1 #include 2 using namespace std; 3 4 // Returns number of pennies if pennies are doubled numDays times 5 long long DoublePennies(long long numPennies, int numDays) { 6 long long totalPennies; 7 8 /* Your solution goes here */ 9 10 11 else { totalPennies - DoublePennies((numPennies * 2), numDays } - 1); 12 13 14 return totalPennies; 15 16 17 18 19 // Program computes pennies if you have 1 penny today, // 2 pennies after one day, 4 after two days, and so on int main() { long long startingPennies; int userDays; 20 21 22 23 24 25 26 27 startingPennies = 1; userDays = 10; cout>userDays; cout

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!