I need to use the while() loop to print a table of Fahrenheit and Celsius temperature equivalents from –50 degrees F to 50 degrees F in 5-degree increments
To convert from Fahrenheit to Celsius I need subtract 32 from the temperature, multiply by 5, and divide by 9
Looks like conversion works but the Fahrenheit column remains the same
What's the issue here?
<html>
<head>
<meta charset="UTF-8">
<title>Unit 3 part 2</title>
</head>
<body>
<?php
$min_fahr = -50;
$max_fahr = 50;
$celsius = ($max_fahr - 32) * 5 / 9;
?>
<table border="1" cellpadding="3">
<thead>
<td>Fahrenheit</td>
<td>Celsius</td>
</thead>
<?php
while ($min_fahr <= $max_fahr) {
print "<tr><td>$max_fahr</td><td>$celsius</td></tr>";
$min_fahr += 5;
$celsius -= 5;
} ?>
</table>
</body>
</html>