Friday 20 July 2018

AngularJS Basic Programs

Calculate all arithmetic operation
<html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<style>
table{
      border:1px solid black;
            height:50px;
            width:400px;
            padding-top:10px;
            padding-bottom:10px;
            padding-left:20px;
            background-color:gray;
            }
</style>
</head>
<body>
<center>
<h2>Arithmetic Operations</h2>
<div ng-app="">
<table>

<tr>
<td>Enter first number</td>
<td><input type="number" ng-model="a"></td>
</tr>

<tr>
<td>Enter second number</td>
<td><input type="number" ng-model="b"></td>
</tr>

</table></br></br>

<p>Addition of two number: {{a+b}}</p></br>
<p>Subtraction of two number: {{a-b}}</p></br>
<p>Multiplication of two number: {{a*b}}</p></br>
<p>Division of two number: {{a/b}}</p>
</div>
</center>
</body>
</html>

Compute Area of Circle
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
<center>
<h1> Area of circle</h1>
<div ng-app="">
Enter value radius:<input type="number" ng-model="r"></p></br>
<p>Area of circle: {{3.14*r*r}}</p>
</div>
</center>
</body>
</html>

Compute Area of Rectangle
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
<center>
<h1> Area of Rectangle</h1>
<div ng-app="">
Enter value of Length:<input type="number" ng-model="L"></p></br>
Enter value of Breadth:<input type="number" ng-model="B"></p></br>
<p>Area of rectangle: {{L*B}}</p>
</div>
</center>
</body>
</html>

Compute Area of Square
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
<center>
<h1> Area of Square</h1>
<div ng-app="">
Enter value of side:<input type="number" ng-model="a"></p></br>
<p>Area of triangle: {{a*a}}</p>
</div>
</center>
</body>
</html>

Compute Area of Triangle
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
<center>
<h1> Area of Triangle</h1>
<div ng-app="">
Enter value of base:<input type="number" ng-model="b"></p></br>
Enter value of height:<input type="number" ng-model="h"></p></br>
<p>Area of triangle: {{0.5*b*h}}</p>
</div>
</center>
</body>
</html>

1 comment:

  1. Python is an open-source, high level, interpreted programming language which offers great opportunities for object-oriented programming. Choosing a python training program from Red Prism Group, which is best training institute for python in noida.

    ReplyDelete

apply function in R

1) apply function: It takes 3 arguments matrix,margin and function.. Example: m<-matrix(c(1,2,3,4),nrow=2,ncol=2) m #1 indicates it is ap...