$money = 0;
$paycheck = 5;
$robotCost = 100;
while ($money + $paycheck < $robotCost) {
echo "Vi har ";
echo $money + $paycheck;
echo " kr";
echo "<br>";
echo "Vi har desværre ikke råd til robotten";
echo "<br>";
$money += $paycheck;
echo "<br>";
}
if ($money + $paycheck == $robotCost) {
echo "vi har $robotCost kr";
echo "<br>";
echo "Nu kan vi købe robotten!";
}
?>
Måske var det ikke lige tanken at man skulle inkludere et if-statement. Men det virker


