How To Make Student Grade Finding System in Html and Java Script

Vu Old Solved Programming Based Assignments Codes are Available in this Section.
Post Reply
User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 177
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

How To Make Student Grade Finding System in Html and Java Script

Post by ALI RAZA » Fri Aug 31, 2018 8:51 am

How To Build A Program That Finds Student Grade Using Java Script and Html .Just Create Html file and Past This code in it and Run. May be Help Full In Building An Assignments of CS Thanks :P

Image

Code: Select all

<html>
<head>
<script language="javascript" type="text/javascript">

function resetField(txtfield) {
	txtfield.style.backgroundColor = "white"; 
	txtfield.value = "";
	txtfield.focus();
}
function findGrades() {	
	
	txtfield = document.getElementById("gpa");
	
	GPA = txtfield.value;
	numericvalue = parseFloat(GPA);	
	
	if(!isNaN(numericvalue)){
		if(GPA == 4){		
			txtfield.style.backgroundColor = "lime";
			window.alert("Excellent :: You got A grade");			
			return true;			
		}
		else if(numericvalue >= 3 && numericvalue < 4){
			txtfield.style.backgroundColor = "lime";
			window.alert("Very Good :: You got B grade");	
			return true;		
		}
		else if(numericvalue >= 2 && numericvalue < 3){
			txtfield.style.backgroundColor = "lime";
			window.alert("Good :: You got C grade");	
			return true;		
		}
		else if(numericvalue >= 1 && numericvalue < 2){
			txtfield.style.backgroundColor = "lime";
			window.alert("Fair :: You got D grade");	
			return true;		
		}
		else {
			txtfield.style.backgroundColor = "lightskyblue";
			window.alert("Numeric value must be between 1 and 4");
			resetField(txtfield);
			return false;
		}
	}
	else if(GPA == "") {
		txtfield.style.backgroundColor = "pink";
		window.alert("Please enter GPA");
		resetField(txtfield);
		return false;
	}
	else {
		txtfield.style.backgroundColor = "red";
		window.alert("Please enter numeric value only");
		resetField(txtfield);
		return false;
	}
}
</script>

<title>CS101 :: Assignment 3</title>
</head>

<body bgcolor="#CCCCCC">
<p>&nbsp;</p>
<h1 align="center">Your VU-ID Here :: Assignment 3 (CS101)</h1><br>
<form  method="post" action="http://www.vusociety.com">
<table width="350" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF">
  <tr>
    <td align="right" valign="middle"><strong>GPA :</strong></td>
    <td height="50" align="left" valign="middle"><input name="gpa" type="text" id="gpa" size="30"></td>
  </tr>
  <tr>
    <td>&nbsp;
      </td>
    <td height="50"><input name="submit" type="submit" id="submit" onClick="return findGrades()" value="Find Grades" style="font-weight:bold; padding:3px; width:120px;"></td>
  </tr>
</table>
</form>
</body>
</html>



User avatar
Princes_Noor
☬☬☬☬☬☬☬☬☬☬☬☬☬☬
☬☬☬☬☬☬☬☬☬☬☬☬☬☬
Posts: 5
Joined: Tue Oct 23, 2018 8:59 pm
Been thanked: 1 time
Status: Offline

Re: How To Make Student Grade Finding System in Html and Java Script

Post by Princes_Noor » Sat Nov 03, 2018 8:28 pm

Thanku :D :D :D :D :D :D

User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 177
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

Re: How To Make Student Grade Finding System in Html and Java Script

Post by ALI RAZA » Sun Nov 04, 2018 8:47 pm

noor wrote:
Sat Nov 03, 2018 8:28 pm
Thanku :D :D :D :D :D :D
:D :D :D :roll: :roll: :roll: :cry: :cry: :cry: :P :P

Post Reply

Last 10 Members Who Visited This Topic

User avatar ALI RAZA (5), User avatar Princes_Noor (2)

  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest