subject

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.

public class calculatepennies {
// returns number of pennies if pennies are doubled numdays times
public static long doublepennies(long numpennies, int numdays) {
long totalpennies = 0;

/* your solution goes here */

else {
totalpennies = doublepennies((numpennies * 2), numdays - 1);
}
return totalpennies;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
You install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unknown users cant access your computer through team viewer?
Answers: 2
question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
You know the right answer?
Write code to complete doublepennies()'s base case. sample output for below program:

nu...
Questions
question
Social Studies, 05.02.2020 00:48
question
History, 05.02.2020 00:48
Questions on the website: 13722367