subject

Write code to complete DoublePennies()'s base case. Sample output for below program:Number of pennies after 10 days: 1024#include // 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(void) {long long startingPennies = 0;int userDays = 0;startingPennies = 1;userDays = 10;printf("Number of pennies after %d days: %lld\n", userDays, DoublePennies(startingPennies, userDays));return 0;}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
Reading characters and strings from the keyboard: consider the following c++ program 1. #include 2. #include 3. using namespace std; 4. mystring1 5. 6. int main() 7. { 8. 9. string mystring1, mystring2; mychar1 10. 11. 12. char mychar1, mychar2; 13. 14. cout< < "enter a string: "; mychar2 15. 16. cin> > mystring1; // 17. cin.get(mychar1); 18. cin> > mychar2; 19. getline(cin,mystring2); mystring2 20. 21. 22. cout<
Answers: 1
question
Computers and Technology, 22.06.2019 09:00
Howard is designing a chair swing ride. the swing ropes are 5 meters long, and in full swing they tilt in an angle of 29° outside chairs to be 2.75 m above the ground in full swing.
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
You know the right answer?
Write code to complete DoublePennies()'s base case. Sample output for below program:Number of pennie...
Questions
question
Mathematics, 03.02.2021 18:20
question
Mathematics, 03.02.2021 18:20
question
Mathematics, 03.02.2021 18:20
question
Mathematics, 03.02.2021 18:20
Questions on the website: 13722360