DekGenius.com
Previous Section  < Day Day Up >  Next Section

C.2 Chapter 3

C.2.1 Exercise 1:

  1. false

  2. true

  3. true

  4. false

  5. false

  6. true

  7. true

C.2.2 Exercise 2:

Message 3.Age: 12. Shoe Size: 14

C.2.3 Exercise 3:

$fahr = -50;
$stop_fahr = 50;
print '<table>';
print '<tr><th>Fahrenheit</th><th>Celsius</th></tr>';
while ($fahr <= $stop_fahr) {
    $celsius = ($fahr - 32) * 5 / 9;
    print "<tr><td>$fahr</td><td>$celsius</td></tr>";
    $fahr += 5;
}
print '</table>';

C.2.4 Exercise 4:

print '<table>';
print '<tr><th>Fahrenheit</th><th>Celsius</th></tr>';
for ($fahr = -50; $fahr <= 50; $fahr += 5) {
    $celsius = ($fahr - 32) * 5 / 9;
    print "<tr><td>$fahr</td><td>$celsius</td></tr>";
}
print '</table>';

    Previous Section  < Day Day Up >  Next Section