Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

college form:

<!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>

<tr><td>Contact Number: </td>


<td>
<input type="text" name="contact"
ng-model="obj.contact"/>
</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;
}

print("the sum is: $sum");


}
--------------------------------------------------
//function overloading(.dart)
void add({int? a, int? b}) {
if (a != null && b != null) {
print("${a + b}");
}
else {
print("Both parameters are required.");
}}
void main() {
add(a: 5, b: 3);
add(a: 5);
}
--------------------------------------------------
//Overriding(.dart)
class Shape{
void disp(){
print("We have many shapes");
}
}
class Triangle extends Shape{
void disp(){
print("Triangle has 3 sides");
}
}
void main(){
Triangle t=new Triangle();
t.disp();
Shape s=new Shape();
s.disp();
}
----------------------------------------------
//for loop(.dart)
void main(){
var fruit={"Apple","Banana","Cherry"};
for (var x in fruit){
print(x);
}
}
-------------------------------------------------
//Interface(.dart)
class A{
void printdata(){
print("Hello there");
}
}
class B implements A{
void printdata(){
print("Hola! Como estas!");
}
}
void main(){
B b=new B();
b.printdata();
}
===================================================
//basic directive in angular js(.js)
<html>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></
script>

<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)

const express = require('express');

const app = express();


const port = 3000;

app.get('/', (req, res) => {


res.sendFile('C:/Users/DELL/OneDrive/Desktop/406/1.html');
});

app.listen(port, () => {
console.log("example app listening on port {$port}");
});
----------------------------------------------------------
<html>
<body>
<h1> hello world</h1>
</body>
</html>
==============================================================

You might also like