Tuesday, January 4, 2011

[discussion_vu] CS101 Assignment#3 101% Solution by Ali

Dear fellow Students...
CS101 Assignment#3 101% Solution by Ali....Do not copy please...

<html>
<head>
<title>Untitled Document</title>
<script type="text/javascript" language="javascript">
function check(numstr)
{
var a=document.getElementById('fid').value;
var regex1=/^[0-9-.]*$/;
if(document.theform.grd.value.length<1)
{

document.theform.grd.style.backgroundColor="pink";
alert("Please enter CGPA!");
document.theform.grd.style.backgroundColor="white";
document.getElementById('fid').focus();
}
else if(regex1.test(a)==false)
{
document.theform.grd.style.backgroundColor="red";
alert("Please enter numeric value only");
document.theform.grd.style.backgroundColor="white";
document.getElementById('fid').focus();
}
else if(document.theform.grd.value>4 || document.theform.grd.value<1)
{
document.theform.grd.style.backgroundColor="lightskyblue";
alert("Numeric Value Must be Between 0 and 4");
document.theform.grd.style.backgroundColor="white";
document.getElementById('fid').focus();
}
else if(document.theform.grd.value>=1 && document.theform.grd.value<2)
{
document.theform.grd.style.backgroundColor="lime";
alert("Fair :: You got D grade");
document.theform.submit();
}
else if(document.theform.grd.value>=2 && document.theform.grd.value<3)
{
document.theform.grd.style.backgroundColor="lime";
alert("Good :: You got C grade");
document.theform.submit();
}
else if(document.theform.grd.value>=3 && document.theform.grd.value<4)
{
document.theform.grd.style.backgroundColor="lime";
alert("Very Good :: You got B grade");
document.theform.submit();
}
else if(document.theform.grd.value=4)
{
document.theform.grd.style.backgroundColor="lime";
alert("Excellent :: You got A grade ");
document.theform.submit();
}

}
</script>
</head>

<body bgcolor="#666666">
<h1 align="center">StudentID :: Assignment 3 (CS101)</h1>
<form name="theform" action="http://www.vu.edu.pk">
<table border="1px" align="center" cellpadding="10px" cellspacing="1px">
<tr>
<td width="46">
CGPA </td>
<td width="199">
<input type="text" width="20px" name="grd" id="fid" />
</td>
</tr>
<tr>
<td>&nbsp;

</td>
<td>
<input type="button" value="Find Grade" onClick="check()"/>
</td>
</tr>
</table>
</form>
</body>
</html>



--
█▓▒░ Hafiz Salman Majeed░▒▓█
            www.vuaskari.com
Google Groups
Subscribe to ::::::II VU ASKARI II::::::
Email:
Visit this group
MBA -III (Finance Group)
                  LAHORE

اللہ آپ کو آسانیاں عطا فرمائے۔
جزاكم الله خيرا وأحسن الجزاء في الدنيا والأخرة



--
You received this message because you are subscribed to the Google Groups "Virtual University of Pakistan" group.
To post to this group, send email to discussion_vu@googlegroups.com.
To unsubscribe from this group, send email to discussion_vu+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/discussion_vu?hl=en.

No comments:

Post a Comment

PAID CONTENT