Christina Cacioppo

for loops, recursion
Student approved

## Introduction

Imagine this: last January 1, you went for a walk and found a pair of magic bunnies. You decided to take them home.

On the bunnies' two-month birthday, they gave birth to another pair of magic bunnies. Then, every month after, each bunny pair bore another pair.

By the end of the year – 12 months later – how many pairs of bunnies will you have?

## Task

Complete the `bunniesIn(month)`

function. It should tell us how many pairs of bunnies you'll have in a given month.

## Starter code

```
class Bunny{
public static void main(String[] args){
int pairs = bunniesIn(11);
System.out.println("There are " + pairs + " pairs of bunnies in November");
}
static int bunniesIn(int month){
/* Your code here */
}
}
```

## Expected output

As written, the program will produce:

`There are 89 pairs of bunnies in November`

As well, here's a table with the number of bunny pairs for each month of the first 12:

Month | Bunny pairs |

1 | 1 |

2 | 1 |

3 | 2 |

4 | 3 |

5 | 5 |

6 | 8 |

7 | 13 |

8 | 21 |

9 | 34 |

10 | 55 |

11 | 89 |

12 | 144 |

## One solution

## Useful tools to solve the problem