0

hello, I'm a in PHP development and I have a question for you pro's:
can you help me fix my code?
I'm trying to make a conversion table: Fahrenheit(Tf) -> celsius(Tc)
starting from Tf: 32 with steps of 5Tf and ends if Tc is over 100
I have tried to use a while-loop but it doesnt validate. any help would be appreciated

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http:/www.w3.org/TR/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type"
content="text/html; charset=iso-8859-1" />
<title> Oefeningen 3 week 1</title>
</head>
<body>


<table border="1">
	<tr>
		<th>Fahrenheit</th>
		<th>Celsius</th>
	</tr>
	<?php
	$Tf = 32 ;
	$Tc = 0.00;
	
	while( $Tc < 100.01):
	
	<tr>
		<th> <?php $Tf ?>   </th>
		<th> <?php $Tc ?>	</th>
	</tr>
	
	
	$Tf= $Tf + 15;
	$Tc= ($Tf-32)*(5/9);	
	endwhile;
	?>
</body>
</html>
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by hielo
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http:/www.w3.org/TR/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type"
content="text/html; charset=iso-8859-1" />
<title> Oefeningen 3 week 1</title>
</head>
<body>


<table border="1">
    <tr>
        <th>Fahrenheit</th>
        <th>Celsius</th>
    </tr>
    <?php
    $Tf = 32 ;
    $Tc = 0.00;
    
    while( $Tc < 100.01)
    {
    ?>
    
    <tr>
        <td> <?php echo $Tf; ?>   </td>
        <td> <?php echo $Tc; ?>    </td>
    </tr>
    
    <?
        $Tf= $Tf + 15;
        $Tc= ($Tf-32)*(5/9);    
    }
    ?>
</table>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.