hello i am having troble with the following problem:
there are 10 animals in a lab and enough food for 1000 animals. Every hour the population of animals doubles, and enough food is added for 4000 more animals. how many hours it will take for the population to outgrow outgrow the food supply. Display a line of information each time.
here is my code:
import java.awt.*;
import hsa.Console;
public class RandomNumbers
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
int animals, food, hours;
animals = 10;
food = 1000;
hours = 0;
while(animals < food);
{
hours ++;
animals = animals * 2;
food = food + 4000;
c.println("In " + hours + "hours there are " + animals + "and food for " + food);
}
}
}
for some reason, my output screen is blank. why is this. what am i doing wrong.
Thanks
Edited by: Tradeoff on Jul 14, 2008 10:43 PM