Yes, this is part of a homework which I've tried to do 2 days now...
I tried to translate it as good as I can
"if rock is thrown directly up from the ground with starting speed of 20 meters/second, rock's height s (meters) after t (seconds) can be count with this formula:
s = -5t2 + 20t
Make a program, which counts and prints rock's height on each second."
I've tried this with different changes but none of them have worked so far:
$time = 1;
$height = 1;
while ($height > 0) {
$height = ((-5*$time*2)+(20*$time));
$time++;
echo "Rock's height is " . $height . " when " . $aika . " -seconds has passed.<br />";
}
And this prints out infinite lines of this:
Rock's height is 10 when -seconds has passed.
Rock's height is 20 when -seconds has passed.
Rock's height is 30 when -seconds has passed.
Rock's height is 40 when -seconds has passed.
Rock's height is 50 when -seconds has passed.
Rock's height is 60 when -seconds has passed.
Rock's height is 70 when -seconds has passed.
Rock's height is 80 when -seconds has passed.
Rock's height is 90 when -seconds has passed.
Rock's height is 100 when -seconds has passed.
It goes on and on.
So ... what am I doing wrong / not getting?
-RedPillow