<html>
<head>
<link rel="stylesheet" type="text/css" href="clac.css" />
	<title>Grade Calculator</title>
</head>
<body>
<?php



$grade = 0;

//if grade put in is >= than 0 and <= 100 
if ($_POST['assignments'] >= 0 && ($_POST['assignments'] <= 100))
	$grade = $grade + $_POST['assignments'] * 0.10;
else
  	$grade = 0; 
	
	if ($_POST['assignments2'] >= 0 && ($_POST['assignments2'] <= 100))
	$grade = $grade + $_POST['assignments2'] * 0.10;
else
  	$grade = 0; 
	
	if ($_POST['assignments3'] >= 0 && ($_POST['assignments3'] <= 100))
	$grade = $grade + $_POST['assignments3'] * 0.10;
else
  	$grade = 0;
	
	if ($_POST['assignments4'] >= 0 && ($_POST['assignments4'] <= 100))
	$grade = $grade + $_POST['assignments4'] * 0.10;
else
  	$grade = 0;
	
	if ($_POST['assignments5'] >= 0 && ($_POST['assignments5'] <= 100))
	$grade = $grade + $_POST['assignments5'] * 0.10;
else
  	$grade = 0; 
	
	if ($_POST['quiz'] >= 0 && ($_POST['quiz'] <= 100))
		$grade = $grade + $_POST['quiz'] * 0.20;
	else
		$grade = 0;
	
		if ($_POST['exam'] >= 0 && ($_POST['exam'] <= 100))
			$grade = $grade + $_POST['exam'] * 0.30;
		else
			$grade = 0; 

?>
<?php
echo "Grade Report: <br />";
echo "<br />";
?>

Your final grade percentage will be:  <?php echo $grade . "%";
echo "<br />";
{
if ($grade >= 100.0)
	echo "Your final grade for the course will be: A+ <br />";
elseif ($grade >= 95)
	echo "Your final grade for the course will be: A  <br />";
elseif ($grade >= 93)
	echo "Your final grade for the course will be: A-  <br />";
elseif ($grade >= 91)
	echo "Your final grade for the course will be: B+  <br />";
elseif ($grade >= 87)
	echo "Your final grade for the course will be: B  <br />";
elseif ($grade >= 83)
	echo "Your final grade for the course will be: B-  <br />";
elseif ($grade >= 80)
	echo "Your final grade for the course will be: C+  <br />";
elseif ($grade >= 76)
	echo "Your final grade for the course will be: C  <br />";
elseif ($grade >= 73)
	echo "Your final grade for the course will be: C-  <br />";
elseif ($grade >= 71)
	echo "Your final grade for the course will be: D  <br />";
else
	echo "Your final grade for the course will be: F  <br />";

}

?>
</body>
</html>