subject

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;}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 15:30
Some of the items below indicate the steps required to move a slide to a different location in a presentation. select those steps and indicate the order in which they should be performed to move the slide. (for example, if an item describes what you do first, select 1.) included in the list are items that are not part of the process. for these items, select n/a, an abbreviation for not applicable. 1 β€” first 2 β€” second 3 β€” third 4 β€” fourth 5 β€” fifth 6 β€” sixth n/a β€” not applicable drag the slide to the desired place. enter the slide position desired. hold the mouse button down. select move from the tools menu. select the slide. switch to the notes view.
Answers: 3
question
Computers and Technology, 21.06.2019 19:30
Write a function processpeople() that takes the name of a file as a parameter. each line of the file corresponds to information about a person. in particular a line contains either a name (in the form lastname,firstname with no spaces in it) or a name (lastname,firstname) and a year. the function will process the file, creating a person object for each line in the file. the function will print information about each line as it processes it, as well as appending the new person object into a list. make sure to use person methods to display information rather than recreating the work you did for the first problem. once the entire file has been processed, the function returns the list of person objects created from the file. if the file is empty, the function should return an empty list. if the input file cannot be opened, the function should print a message to that effect and then return an empty list. the following shows what would be displayed for two example files which have been provided in the link. the file none.txt does not exist. note that your function must work on an arbitrary file that consists of valid lines. you cannot assume anything about the file except that it contains lines that have the format described above.
Answers: 2
question
Computers and Technology, 22.06.2019 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
question
Computers and Technology, 22.06.2019 10:20
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
You know the right answer?
Write code to complete DoublePennies()'s base case. Sample output for below program:Number of pennie...
Questions
question
Mathematics, 04.02.2020 17:00
question
Chemistry, 04.02.2020 17:00
question
English, 04.02.2020 17:00
Questions on the website: 13722360