VB icon

Average Grade Checker

Email
Submitted on: 9/1/2015 1:50:48 PM
By: Jake R. Pomperada  
Level: Beginner
User Rating: By 1 Users
Compatibility: PHP 3.0, PHP 4.0, PHP 5.0
Views: 5116
author picture
 
      I have here a program that I wrote in my programming class in PHP before I called this program Average Grade Checker in PHP that will compute the grade of the student from prelim, midterm, prefinal and endterm grading period. The code is very easy to understand and very useful for those you are just starting learning PHP programming. If you have some questions about programming, about my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at my mobile number 09173084360. Thank you very much and Happy Programming.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Average Grade Checker 
// Description:
I have here a program that I wrote in my programming class in PHP before I called this program Average Grade Checker in PHP that will compute the grade of the student from prelim, midterm, prefinal and endterm grading period. The code is very easy to understand and very useful for those you are just starting learning PHP programming.
If you have some questions about programming, about my work please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com. People here in the Philippines can contact me at my mobile number 09173084360.
Thank you very much and Happy Programming.
// By: Jake R. Pomperada
//**************************************

<html>
<head> <center> <u> <font size="6" color="darkblue"> Average Grade Checker
<title> Grade Checker </title>
</font> </u> </center> </head>
<body bgcolor="lightgreen">
<?php
	error_reporting(0);
	if ($_REQUEST['submit'])
	{
		$prelim=trim($_REQUEST['prelim']);
		$midterm=trim($_REQUEST['midterm']);
		$pfinal=trim($_REQUEST['pfinal']);
		$final=trim($_REQUEST['final']);
		$grade=($prelim+$midterm+$pfinal+$final)/4;
			if ($grade>=75)
			{
				echo "<script>";
				echo "alert('You Passed.');";
				echo "</script>";
			}
			else
			{
				echo "<script>";
				echo "alert('You Failed.');";
				echo "</script>";
			}
	}
	if ($_REQUEST['clear'])
	{
		$prelim="";
		$midterm="";
		$pfinal="";
		$final="";
		$grade="";
	}
?>
<form method="post" action="">
<label> Prelim Grade: </label> <br/>
<input type="text" name="prelim" value="<?php echo $prelim; ?>" 
<label> Midterm Grade: </label> <br/>
<input type="text" name="midterm" value="<?php echo $midterm; ?>" 
<label> Prefinal Grade: </label> <br/>
<input type="text" name="pfinal" value="<?php echo $pfinal; ?>" 
<label> Final Grade: </label> <br/>
<input type="text" name="final" value="<?php echo $final; ?>" 
<label> Average Grade: </label> </br>
<input type="text" name="grade" value="<?php echo $grade; ?>" 
<br><br>
<input type="submit" name="submit" value="Submit">
<input type="submit" name="clear" value="Clear">
</form>
</body>
</html>


Other 57 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.