<html>
<body ng-app="mainApp"
ng-controller="studentController">
<center>
<form name="f1">
<table border="1">
<tr>
<td>Enter roll number</td>
<td><input type="number"
ng-model="rollno"></td>
</tr>
<td>Enter student name: </td>
<td><input type="text"
name="sname" ng-model="studName"></td>
</tr>
<td>Enter Class </td>
<td><input type="text"
name="sclass" ng-model="class1"> </td>
</tr>
<td>Enter Subject1 Marks</td>
<td> <input type="number"
name="subject1" ng-model="sub1"></td>
</tr>
<td>Enter Subject2 Marks</td>
<td> <input type="number"
name="subject2" ng-model="sub2"></td>
</tr>
<td>Enter Subject3 Marks</td>
<td> <input type="number"
name="subject3" ng-model="sub3"></td>
</tr>
<td> <input type="button"
value="Display Result" ng-click="isShowHide('show')">
</td>
</tr>
</form>
</div>
<br><br>
<h1 style=color:green;>Mark Sheet of
Student</h1>
<form name="f2"
ng-controller="studentController">
<table border="2">
<thead>
<td>Rollno</td>
<td>Name</td>
<td>Class</td>
<td>Subject1</td>
<td>Subject2</td>
<td>Subject3</td>
<td>Total</td>
<td>Percentage</td>
<td>Grade</td>
</thead>
<!-- ng-model-(name used)-->
<tr>
<td>{{rollno}}</td>
<td>{{studName}}</td>
<td>{{class1}}</td>
<td>{{sub1}}</td>
<td>{{sub2}}</td>
<td>{{sub3}}</td>
<td>{{sub1 + sub2 + sub3}}</td>
<td>{{((
sub1+sub2+sub3)/300)*100;}}</td>
<td><input type="text"
name="grade" ng-model="grade"></td>
</tr>
</table>
</div>
var mainApp = angular.module("mainApp",
[]);
mainApp.controller('studentController', function
($scope) {
if (param=="show") {
$scope.showval = true;
}
$scope.grade="A";
else if($scope.per=60 &&
$scope.per<74)
$scope.grade="First";
else if($scope.per>=45 &&
$scope.per<59)
$scope.grade="Second";
else if($scope.per>=35 &&
$scope.per<45)
$scope.grade="Pass";
else
$scope.grade="fail";
}
});
</script>
</center>
</body>