<html>
<head>
<title>Grade Calculator</title>
</head>
<?php
?>
<body>
<?php
$grade = $_POST["Quiz1"] * 0.05 + $_POST["Mid-Term"] * 0.30 + $_POST["Quiz2"] * 0.05 + $_POST["AL1"] * 0.05 + $_POST["AL2"] * 0.05 + $_POST["Participation"] * 0.10 + $_POST["Final"] * 0.40 ;
?>
<?php
echo "Grade Report: <br />";
echo "<br />";
?>
Your final grade percentage will be: <?php echo $grade ;
echo "<br />";
{
if ($grade > 90.9)
echo "Your final grade for the course will be: A+ <br />";
elseif ($grade > 85.9)
echo "Your final grade for the course will be: A <br />";
elseif ($grade > 79)
echo "Your final grade for the course will be: A- <br />";
elseif ($grade > 76.9)
echo "Your final grade for the course will be: B+ <br />";
elseif ($grade >71.9)
echo "Your final grade for the course will be: B <br />";
elseif ($grade > 69.9)
echo "Your final grade for the course will be: B- <br />";
elseif ($grade > 65.9)
echo "Your final grade for the course will be: C+ <br />";
elseif ($grade > 59.9)
echo "Your final grade for the course will be: C <br />";
elseif ($grade > 54.9)
echo "Your final grade for the course will be: C- <br />";
elseif ($grade > 49.9)
echo "Your final grade for the course will be: Pass <br />";
else
echo "Your final grade for the course will be: Fail <br />";
}
?>
</body>
</html>
Above is the code I have used for my php program which is linked to a html file, this program calculates grades, everything is correct, except for the fact that If the user selects the option "not done yet / excused", it must be able to calculate without taking the % of the whatever quzi, mid-term, etc that that they missed, ie if they have only taken 50% of the available marks in the course, it must be able to just calculate that.
Could someone help me on this, any help is greatly appreciated
Thanks,
Tony