Micaela's Chicken Report 🐔
| Group 1 | Group 2 | Group 3 |
|---|---|---|
| 12 | 40 | 34 |
Total: 86
This month we had a total of 86 eggs!

CODE FOLLOWS
<?php
include('../includes/header.php');
// code
error_reporting(E_ALL); // set error reporting to all
// function 1 calculation
function totalEggs($g1, $g2, $g3)
{
return $g1 + $g2 + $g3;
}
// function 2 table display
function showGroupsTable($g1, $g2, $g3)
{
echo "<table border='1' cellpadding='10' style='border-collapse:collapse; text-align:center;'>";
echo "<tr>";
echo "<th>Group 1</th>";
echo "<th>Group 2</th>";
echo "<th>Group 3</th>";
echo "</tr>";
echo "<tr>";
echo "<td>$g1</td>";
echo "<td>$g2</td>";
echo "<td>$g3</td>";
echo "</tr>";
echo "</table>";
}
// function 3 total message
function showMessage($total)
{
echo "<h3>This month we had a total of $total eggs!</h3>";
}
// values
$group1 = 12;
$group2 = 40;
$group3 = 34;
$total = totalEggs($group1, $group2, $group3);
echo "<h1>Micaela's Chicken Report 🐔</h1>";
showGroupsTable($group1, $group2, $group3);
echo "<h3>Total: $total</h3>";
showMessage($total);
echo "<br><img src='../images/egg.gif' width='140'>";
echo "<br><br>";
include('../includes/footer.php');
?>