id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

zombieCount


A zombie outbreak is spreading… On day 0, there is 1 zombie. Each day: Normally, the number of zombies doubles But on every 3rd day, the zombies sleep: They do not double 1 zombie dies Write a recursive method that returns the number of zombies after a given number of days.


zombieCount(0) → 1
zombieCount(1) → 2
zombieCount(2) → 4

...Save, Compile, Run (ctrl-enter)

public int zombieCount(int days) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy