Professional Documents
Culture Documents
Advanced Practicals
Advanced Practicals
<!DOCTYPE html>
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/an
gular.min.js">
</script>
</head>
<body ng-app >
<center>
<form name="Collegeform">
<table border=10>
<tr>
<td colspan="2"><b>Enter College Details</b></td>
</tr>
<tr>
<td>College Name: </td>
<td>
<input type="text" name="clgname"
ng-model="obj.clgname"/>
</td></tr>
<br><br>
<tr><td> Address:</td>
<td>
<input type="text" name="address" ng-model="obj.address"
/>
</td></tr>
<br><br>
<tr><td>
Email: </td><td>
<input type="email" ng-model="college.email" name="email" />
</td></tr>
<br><br>
<tr>
<td>
<input type="submit" value="Submit" />
</td>
<td>
<input type="reset" value="Clear" />
</td>
</tr>
</center>
</body>
</html>
==================================================
//addition of 2 nos(.dart)
import 'dart:io';
void main() {
print('Enter the first number:');
int num1 = int.parse(stdin.readLineSync() ?? '0');
print('Enter the second number:');
int num2 = int.parse(stdin.readLineSync() ?? '0');
int sum = num1 + num2;
print('The sum of $num1 and $num2 is $sum');
}
--------------------------------------------------
//sum from 1 to 100(.dart)
import 'dart:io';
void main(){
int sum=0;
for(int i=1;i<=100;i++)
{
sum=sum+i;
}
<body>
<div ng-app="">
<p>Name:<input type="text" ng-model="name"/></p>
<p ng-bind="name" > </p>
</div>
</body>
</html>
====================================================
calculator using node js
// calc.js
module.exports.add = function(a, b) {
return a + b;
}
module.exports.sub = function(a, b) {
return a - b;
}
module.exports.mul = function(a, b) {
return a * b;
}
module.exports.div = function(a, b) {
return a / b;
}
module.exports.mod = function(a, b) {
return a % b;
}
--------------------------------------------------------
//test.js
var http=require('http');
var mymod=require('./calc');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/html'});
res.write("I am checking calculator module");
res.write("addition is:"+mymod.add(10,20));
res.write("<br>");
res.write("Substraction is:"+mymod.sub(10,20));
res.write("<br>");
res.write("Multiplication is:"+mymod.mul(10,20));
res.write("<br>");
res.write("Division is:"+mymod.div(10,20));
res.end();
}).listen(8888);
=========================================================
display content of html file(.js)
app.listen(port, () => {
console.log("example app listening on port {$port}");
});
----------------------------------------------------------
<html>
<body>
<h1> hello world</h1>
</body>
</html>
==============================================================