Computers and Technology

Write code to complete DoublePennies()'s base case. Sample output for below program:Number of pennies after 10 days: 1024#include using namespace std;// Returns number of pennies if pennies are doubled numDays timeslong long DoublePennies(long long numPennies, int numDays){long long totalPennies = 0;/* Your solution goes here */else {totalPennies = DoublePennies((numPennies * 2), numDays - 1);}return totalPennies;}// Program computes pennies if you have 1 penny today,// 2 pennies after one day, 4 after two days, and so onint main() {long long startingPennies = 0;int userDays = 0;startingPennies = 1;userDays = 10;cout << "Number of pennies after " << userDays << " days: "<< DoublePennies(startingPennies, userDays) << endl;return 0;}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:40, EricaLSH7624
Match the personality traits with their description
Answers: 2
image
Computers and Technology, 22.06.2019 10:30, JeroMii
Think about a recent customer service experience - either positive or negative. write a brief summary of that experience. now think about those four characteristics we look for in customer service representatives. how did the representative in your example stack up? write down your answer and give specific examples.
Answers: 1
image
Computers and Technology, 22.06.2019 10:50, whocares1234
A911 dispatcher is the sole sender of messages to all police officers. while on patrol, officers communicate with the dispatcher who, in turn, relays messages to other officers. the officers do not communicate directly with one another. this illustrates a network.
Answers: 1
image
Computers and Technology, 22.06.2019 14:00, GGerardi7552
What are procedures that keep a data base current
Answers: 1
Do you know the correct answer?
Write code to complete DoublePennies()'s base case. Sample output for below program:Number of pennie...

Questions in other subjects:

Konu
Mathematics, 23.01.2022 14:30
Konu
Computers and Technology, 23.01.2022 14:30
Konu
Computers and Technology, 23.01.2022 14:30