Daryl
09-12-2007, 10:06 PM
Can someone please help?!
I need to add a calling statement to the end of the script that calls the checkGrade() function and passes to it the value from the grade form variable. Nothing I tried works! :mad:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Letter Grades</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
function checkGrade($Grade) {
switch ($Grade) {
case "A":
echo "Your grade is excellent.";
break;
case "B":
echo "Your grade is good.";
break;
case "C":
echo "Your grade is fair.";
break;
case "D":
echo "Your are barely passing.";
break;
case "E":
echo "You failed.";
break;
default:
echo "You did not enter a valid letter grade.";
}
}
/* Is this the calling statement that is suppose to be here? It sure doesn't work. $Grade = checkGrade(); */
?>
</body>
</html>
I need to add a calling statement to the end of the script that calls the checkGrade() function and passes to it the value from the grade form variable. Nothing I tried works! :mad:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Letter Grades</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
function checkGrade($Grade) {
switch ($Grade) {
case "A":
echo "Your grade is excellent.";
break;
case "B":
echo "Your grade is good.";
break;
case "C":
echo "Your grade is fair.";
break;
case "D":
echo "Your are barely passing.";
break;
case "E":
echo "You failed.";
break;
default:
echo "You did not enter a valid letter grade.";
}
}
/* Is this the calling statement that is suppose to be here? It sure doesn't work. $Grade = checkGrade(); */
?>
</body>
</html>