Mr. C. likes to take his ladies out and money is no object.
He goes all out and spends at leat $15.00 per date, but once
he only has $10.00 dollars, he stops spending and buys himself
a taco.
| Hey, doll, I'm loaded with cash! I have 15 dollars! |
| Hey, doll, I'm loaded with cash! I have 14 dollars! |
| Hey, doll, I'm loaded with cash! I have 13 dollars! |
| Hey, doll, I'm loaded with cash! I have 12 dollars! |
| Hey, doll, I'm loaded with cash! I have 11 dollars! |
| :Oh, oh...time for a taco! |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Assignment042</title>
<style>
table
{
margin:auto;
}
td
{
border: 1px solid black;
}
</style>
</head>
<body>
<h1>Mr. C. - Big Spender</h1>
<p>Mr. C. likes to take his ladies out and money is no object.
He goes all out and spends at leat $15.00 per date, but once
he only has $10.00 dollars, he stops spending and buys himself
a taco.</p>
<table>
<?php
//set dollar amount
$dollars = 15;
//run process code at least once and then test condition
Do
{
echo "<tr><td>"; //create row and column
echo "Hey, doll, I'm loaded with cash! ";
echo " I have ".$dollars." dollars!";
echo "</tr></td>"; //close row and column
//lose a dollar
$dollars=$dollars-1;
}
while ($dollars > 10) ;//if you have more than 10 dollars loop
if ($dollars == 10)
{
echo "<tr><td>:";
echo "Oh, oh...time for a taco!";
echo "</td></tr>";
}
print show_source("Assignment042.php");
?>
</table>
</body>
</html>
1