Lab 31

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

ExamResult.

html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Examination Result in Javascript</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-
scale=1">
<style>
*{
box-sizing:border-box;
}
body{
margin:0;
font-family:"Lato",sans-sarif;
}
header{
background-color:Aquamarine;
padding:20px;
text-align:center;
}
nav{
height:100%;
width:200px;
position:fixed;
z-index:1;
left:0;
background-color:Beige;
overflow-x:hidden;
padding-top:20px;
text-align:center
}
nav a{
padding:6px 6px 6px 32px;
font-size:25px;
color:#818181;
diaplay:block;
line-height:1.6;
}
nav a:hover{
color:lightblue;
}
</style>
</head>
<body>
<header>
<h1>Examination Result in Java Script</h1>
<p>This is a website to calculate overall CGPA,percentage of
MCA College Students<br/>
Also Finding Total number of Passed and Failed Students </p>
</header>
<nav>
<a href="about.html">About</a>
<a href="ResultDisplay.html">Result Display</a>
<a href="Calculation.html">Calculation</a>
<a href="PassFailCount.html">PassFailCount</a>
</nav>
</body>
</html>
About.html
<html>
<head>
<title>ABOUT</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-
scale=1">
<style>
div{
text-align:center;
background-color:Aqua;
}
*{
box-sizing:border-box;
}
body{
margin:0;
font-family:"Lato",sans-sarif;
}
header{
background-color:Aquamarine;
padding:20px;
text-align:center;

}
nav{
height:100%;
width:200px;
position:fixed;
z-index:1;
left:0;
background-color:Beige;
overflow-x:hidden;
padding-top:20px;
text-align:center
}
nav a{
padding:6px 6px 6px 32px;
font-size:25px;
color:#818181;
diaplay:block;
line-height:1.6;
}
nav a:hover{
color:lightblue;
}
</style>
</head>
<body>
<header>
<h1>Examination Result in Java Script</h1>
<p>This is a website to calculate overall CGPA,percentage of
MCA College Students<br/>
Also Finding Total number of Passed and Failed Students </p>
</header>
<nav>
<a href="about.html">About</a>
<a href="ResultDisplay.html">Result Display</a>
<a href="Calculation.html">Calculation</a>
<a href=”PassFailCount.html”>PassFailCount</a>
</nav>
<div>
<h1>Summary of this Website</h1>
<h2>Procedure to Calculate Percentage</h2>
<img src="C:\html pgms\table.png" height="180" width="320">
<pre style="color:red" >
CGPA=sum(GradePoint*creditpoint)/sum of all credits of
individual max credits
Percentage=CGPA/10
</pre>
<img src="C:\html pgms\theory.png" height="120"
width="320">
</div>
</body>
</html>
ResultDisplay.html
<html>
<head>
<title>ResultDisplay</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-
scale=1">
<style>
div{
text-align:center;
background-color:rgba(255,99,71,0.5);
}
#link{
text-align:center;
}
*{
box-sizing:border-box;
}
body{
margin:0;
font-family:"Lato",sans-sarif;
}
header{
background-color:Aquamarine;
padding:20px;
text-align:center;

}
nav{
height:100%;
width:200px;
position:fixed;
z-index:1;
left:0;
background-color:Beige;
overflow-x:hidden;
padding-top:20px;
text-align:center
}
nav a{
padding:6px 6px 6px 32px;
font-size:25px;
color:#818181;
diaplay:block;
line-height:1.6;
}
nav a:hover{
color:lightblue;
}
footer{
position:fixed;
left=0;
bottom:0;
width:100%;
background-color:red;
color:white;
text-align:center;
}

</style>
</head>
<body>
<header>
<h1>Examination Result in Java Script</h1>
<p>This is a website to calculate overall CGPA,percentage of
MCA College Students<br/>
Also Finding Total number of Passed and Failed Students </p>
</header>
<nav>
<a href="about.html">About</a>
<a href="ResultDisplay.html">Result Display</a>
<a href="Calculation.html">Calculation</a>
<a href=”PassFailCount.html”>PassFailCount</a>
</nav>
<footer>
<p>Note:Enter Grade Points(10,9,8,7,6,5,0) for
sub1grade,sub2grade....,Dont enter A,B,C,D,E,F</p>
</footer>
<div id=link>
<p style="color:DarkGreen">To Know Your Result Click on the
below Link</p>
<a href="https://www.osmania.ac.in/res07/20210420.jsp"
target="_self">Click here </a><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br
><br><br><br><br><br><br><br><br><br><br><br><br>
</div>
</body>
</html>
Calculation.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-
scale=1">
<style>
*{
box-sizing:border-box;
}
body{
margin:0;
font-family:"Lato",sans-sarif;
}
header{
background-color:Aquamarine;
padding:20px;
text-align:center;
}

nav{
height:100%;
width:200px;
position:fixed;
z-index:1;
left:0;
background-color:Beige;
overflow-x:hidden;
padding-top:20px;
text-align:center
}
nav a{
padding:6px 6px 6px 32px;
font-size:25px;
color:#818181;
diaplay:block;
line-height:1.6;
}
nav a:hover{
color:lightblue;
}
footer{
position:fixed;
left=0;
bottom:0;
width:100%;
background-color:red;
color:white;
text-align:center;
}
</style>
<script type="text/javascript">
window.alert("Start calculating Percentage here");
function getReport(){
var result=""; //declare a variable for result

//read the marks


var sub1grade =
document.getElementById('sub1grade').value;
var sub2grade =
document.getElementById('sub2grade').value;
var sub3grade =
document.getElementById('sub3grade').value;
var sub4grade =
document.getElementById('sub4grade').value;
var sub5grade = document.getElementById('sub5grade').value;
var lab1grade = document.getElementById('lab1grade').value;
var lab2grade = document.getElementById('lab2grade').value;
var lab3grade = document.getElementById('lab3grade').value;
var sub1credit = document.getElementById('sub1credit').value;
var sub2credit=document.getElementById('sub2credit').value;
var sub3credit=
document.getElementById('sub3credit').value;
var sub4credit =
document.getElementById('sub4credit').value;
var sub5credit = document.getElementById('sub5credit').value;
var lab1credit = document.getElementById('lab1credit').value;
var lab2credit = document.getElementById('lab2credit').value;
var lab3credit= document.getElementById('lab3credit').value;
//calculate the total marks (using double notation technique)
var
totalcredits=((sub1grade*sub1credit)+(sub2grade*sub2credit)+
(sub3grade*sub3credit)+(sub4grade*sub4credit)+(sub5grade*s
ub5credit)+(lab1grade*lab1credit)+(lab2grade*lab2credit)+(lab
3grade*lab3credit))/26;

//get the average marks


var percentage = totalcredits*10;

let f=0,p=0;
switch(
(sub1grade==0||sub2grade==0||sub3grade==0||sub4grade==
0||sub5grade==0||lab1grade==0||lab2grade==0||lab3grade=
=0)?1:2
)
{
case 1:result="Failed";f++;PassFail=(p+"passed,"+f+"failed.");
break;
case 2:result="Passed";p++;PassFail=(p+"passed,"+f+"failed.");
break;
}
//display the results
document.getElementById('txtStudentName').value =
document.getElementById('txtName').value;
document.getElementById('txtStudentClass').value =
document.getElementById('txtClass').value;
document.getElementById('txtTotalCredits').value =
totalcredits;
document.getElementById('txtPercentage').value =
percentage ;
document.getElementById('txtResult').value = result;
document.getElementById('txtPassFail').value =PassFail;
//document.getElementById('txtFail').value=fail;

} //end of function getReport

</script>
</head>
<body>
<header>
<h1>Examination Result in Java Script</h1>
<p>This is a website to calculate overall CGPA,percentage of
MCA College Students<br/>
Also Finding Total number of Passed and Failed Students </p>
</header>
<nav>
<a href="about.html">About</a>
<a href="ResultDisplay.html">Result Display</a>
<a href=<a href=”PassFailCount.html”>PassFailCount</a>
"Calculation.html">Calculation</a>
</nav>
<footer>
<p>Note:Enter Grade Points(10,9,8,7,6,5,0) for
sub1grade,sub2grade....,Dont enter A,B,C,D,E,F</p>
</footer>
<center style="background-color:AntiqueWhite">

<fieldset style="width:600px" >


<legend><b>Student Input Section:</b></legend>
Name:<input type="text" id="txtName"> <br>
Class:<input type="text" id="txtClass"> <br/><br/>
<table border="1" bgcolor="Orange">
<tr><td>sub1grade</td><td><input type="text"
id="sub1grade"></td></tr>
<tr><td>sub2grade</td><td><input type="text"
id="sub2grade"></td></tr>
<tr><td>sub3grade</td><td><input type="text"
id="sub3grade"></td></tr>
<tr><td>sub4grade</td><td><input type="text"
id="sub4grade"></td></tr>
<tr><td>sub5grade</td><td><input type="text"
id="sub5grade"></td></tr>
<tr><td>lab1grade</td><td><input type="text"
id="lab1grade"></td></tr>
<tr><td>lab2grade</td><td><input type="text"
id="lab2grade"></td></tr>
<tr><td>lab3grade</td><td><input type="text"
id="lab3grade"></td></tr>
<tr><td>sub1credit</td><td><input type="text"
id="sub1credit"></td></tr>
<tr><td>sub2credit</td><td><input type="text"
id="sub2credit"></td></tr>
<tr><td>sub3credit</td><td><input type="text"
id="sub3credit"></td></tr>
<tr><td>sub4credit</td><td><input type="text"
id="sub4credit"></td></tr>
<tr><td>sub5credit</td><td><input type="text"
id="sub5credit"></td></tr>
<tr><td>lab1credit</td><td><input type="text"
id="lab1credit"></td></tr>
<tr><td>lab2credit</td><td><input type="text"
id="lab2credit"></td></tr>
<tr><td>lab3credit</td><td><input type="text"
id="lab3credit"></td></tr>

</table><br/><br/>
<input type="button" value="Get Result"
onclick="getReport()">

</fieldset>

<h2>Report Card</h2>

<table border="1" bgcolor="MediumSeaGreen">


<tr><td>Name</td><td><input type="text"
id="txtStudentName" readonly></td></tr>
<tr><td>Class</td><td><input type="text"
id="txtStudentClass" readonly></td></tr>
<tr><td>Total Credits</td><td><input type="text"
id="txtTotalCredits" readonly></td></tr>
<tr><td>Percentage</td><td><input type="text"
id="txtPercentage" readonly></td></tr>

<tr><td>Remarks</td><td><input type="text"
id="txtResult" readonly></td></tr>
<tr><td>PassFail</td><td><input type="text" id="txtPassFail"
readonly></td></tr>

</table>
<br><br><br><br><br><br>
</center>
</body>
</html>

PassFailCount.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>PassFailCount</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-
scale=1">
<style>
*{
box-sizing:border-box;
}
body{
margin:0;
font-family:"Lato",sans-sarif;
}
header{
background-color:Aquamarine;
padding:20px;
text-align:center;
}
nav{
height:100%;
width:200px;
position:fixed;
z-index:1;
left:0;
background-color:Beige;
overflow-x:hidden;
padding-top:20px;
text-align:center
}
nav a{
padding:6px 6px 6px 32px;
font-size:25px;
color:#818181;
diaplay:block;
line-height:1.6;
}
nav a:hover{
color:lightblue;
}
</style>

<script type="text/javascript">
var passes=0,failures=0,student=1,result;
while(student<=34){
result=window.prompt("Enter result(1=pass,0=fail)","0");
if(result=="1")
passes=passes+1;
else
failures=failures+1;
student=student+1;
}
document.writeln("<h1>Examination Results</h1>");
document.writeln("passed:"+passes+"<br/>Failed:"+failures);
</script>
</head>
<body>
<header>
<h1>Examination Result in Java Script</h1>
<p>This is a website to calculate overall CGPA,percentage of
MCA College Students<br/>
Also Finding Total number of Passed and Failed Students </p>
</header>
<nav>
<a href="about.html">About</a>
<a href="ResultDisplay.html">Result Display</a>
<a href="Calculation.html">Calculation</a>
<a href="PassFailCount.html">PassFailCount</a>
</nav>
<center>
<p>Click Refresh(or Reload) to run the script again</p>
</center>
</body>
</html>

You might also like