When I run this program and call the function BacteriaVariables, the program stops running before inputing the variable. If I print the variable n afterwards it says it is set to zero.
#include <iostream>
#include <cmath>
using namespace std;
Your prompt for k says "[0.0-1.0]", but k is an int. It will not hold a factional number.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.