Batting average solution

   Building a Form   Calculate Your Batting Average             At bats:         Hits:            ');

if ($atbats ===	 || $hits === ) { echo	"Please input at bats and hits!<BR>"; } else { $battingaverage = calculateBA($atbats,$hits); printf ("Your current batting average is %0.3f ", $battingaverage); }

function calculateBA($atbats, $hits){ return $hits/$atbats; } ?> </BODY> </HTML>