0% found this document useful (0 votes)
28 views4 pages

College Form and Dart Code Examples

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views4 pages

College Form and Dart Code Examples

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

college form:

<!DOCTYPE html>
<html>
<head>
<script
src="[Link]
[Link]">
</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="[Link]"/>
</td></tr>

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


<td>
<input type="text" name="contact"
ng-model="[Link]"/>
</td></tr>

<br><br>
<tr><td> Address:</td>
<td>
<input type="text" name="address" ng-model="[Link]"
/>

</td></tr>

<br><br>
<tr><td>
Email: </td><td>
<input type="email" ng-model="[Link]" 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 = [Link]([Link]() ?? '0');
print('Enter the second number:');
int num2 = [Link]([Link]() ?? '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();
[Link]();
Shape s=new Shape();
[Link]();
}
----------------------------------------------
//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();
[Link]();
}
===================================================
//basic directive in angular js(.js)
<html>
<script
src="[Link]
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
// [Link]
[Link] = function(a, b) {
return a + b;
}

[Link] = function(a, b) {
return a - b;
}

[Link] = function(a, b) {
return a * b;
}

[Link] = function(a, b) {
return a / b;
}
[Link] = function(a, b) {
return a % b;
}
--------------------------------------------------------
//[Link]
var http=require('http');
var mymod=require('./calc');
[Link](function(req,res){
[Link](200,{'Content-Type':'text/html'});
[Link]("I am checking calculator module");
[Link]("addition is:"+[Link](10,20));
[Link]("<br>");
[Link]("Substraction is:"+[Link](10,20));
[Link]("<br>");
[Link]("Multiplication is:"+[Link](10,20));
[Link]("<br>");
[Link]("Division is:"+[Link](10,20));
[Link]();
}).listen(8888);
=========================================================
display content of html file(.js)

const express = require('express');

const app = express();


const port = 3000;

[Link]('/', (req, res) => {


[Link]('C:/Users/DELL/OneDrive/Desktop/406/[Link]');
});

[Link](port, () => {
[Link]("example app listening on port {$port}");
});
----------------------------------------------------------
<html>
<body>
<h1> hello world</h1>
</body>
</html>
==============================================================

You might also like