Friday 6 September 2013

Program for Line Drawing using Bresenham’s algorithm

#include<stdio.h>
#include<graphics.h>
#include<math.h>
void main()
{
int gd,gm,i;
float x,y,x1,y1,x2,y2,dx,dy,length,e;

printf("enter the value of x1:\n");
scanf("%f",&x1);
printf("enter the value of y1:\n");
scanf("%f",&y1);
printf("enter the value of x2:\n");
scanf("%f",&x2);
printf("enter the value of y2:\n");
scanf("%f",&y2);

detectgraph(&gd,&gm);
initgraph(&gd,&gm,"C:\\TC\\BGI");

dx=x2-x1;
dy=y2-y1;

x=x1;
y=y1;
e=2*dy-dx;

       for(i=0;i<dx;i++)
       {
putpixel(x,y,RED);

while(e>=0)
{
y++;
e=e-2*dx;
}
x++;
e=e+2*dy;
}
getch();
closegraph();

}

Program for Circle Generation using midpoint algorithm

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm;
int r,x,y,xc,yc;
float d;
clrscr();
initgraph(&gd,&gm,"..\\bgi");
printf("Enter Radius\n");
scanf("%d",&r);
printf("Enter Center of circle\n");

scanf("%d",&xc);
scanf("%d",&yc);
d=1.25-r;
x=0;
y=r;
do
{
if(d<0)
{

x=x+1;
d=d+2*x+1;
}
else
{

x=x+1;
y=y-1;
d=d+2*x-2*y+1;
}
putpixel(xc+x,yc+y,5);
putpixel(xc-y,yc-x,5);
putpixel(xc+y,yc-x,5);
putpixel(xc-y,yc+x,5);
putpixel(xc+y,yc+x,5);
putpixel(xc-x,yc-y,5);
putpixel(xc+x,yc-y,5);
putpixel(xc-x,yc+y,5);
}
while(x<y);
getch();
closegraph();
}

Friday 2 August 2013

DDA line algorithm

#include<stdio.h>
     #include<conio.h>
     #include<graphics.h>
     void main()
     {
    int x1,y1,xn,yn,X,Y,dx,dy,xinc,yinc,i,length;
     int gd=DETECT ,gm;
     initgraph(&gd,&gm,"C:\\TC\\BGI");
     printf("Enter the initial points:");
     scanf("%d%d",&x1,&y1);
     printf("Enter the end points:");
     scanf("%d%d",&xn,&yn);
     dx=xn-x1;
     dy=yn-y1;
     if(dx<=dy)
     {
     length=dy;
     }
     else
     {
     length=dx;
     }
     xinc=dx/length;
     yinc=dy/length;
     X=x1;
     Y=y1;
     i=1;
     putpixel(X,Y,RED);
     while(i<=length)
     {
      X=X+xinc;
      Y=Y+yinc;
      i++;
      putpixel(X,Y,RED);
      }
     getch();
     closegraph();
     }

Tuesday 30 July 2013

To transfer a character from one computer to another.


To transfer a character from one computer to another.



Source Code at Transmitter side:


#include<iostream.h>
#include<dos.h>
#include<io.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
void main()
{
clrscr();
int choice;
cout<<"enter the choice\n";
cout<<"1: character transfer\n";
cout<<"2: string transfer\n";
cout<<"3: file transfer";
cin>>choice;*/
switch(choice)
{
case 1:
void c_transfer();
break;
case 2:
void s_transfer();
break;
case 3:
void f_transfer();
break;
default:
cout<<"Invalid choice";
}
void c_transfer()
{
char ch;
outport(0x3FB,0x8f);
outport(0x3f8,0x00);
outport(0x3f9,0x24);
outport(0x3f9,0x0f);
cout<<"the character recieved is";
cin>>ch;
outport(0x3fb,ch);
cout<<"data has been trasmitted";
getch();
}
oid s_transfer()
{
char s[10];
cout<<"enter the string to be transmitted";
for(i=0;i<10;i++)
{
cin<<s[i];
}
for(i=0;i<10;i++)
{
outport(0x3FB,0x8f);
outport(0x3f8,0x00);
outport(0x3f9,0x24);
outport(0x3f9,0x0f);
outport(0x3f8,s[i]);
}
cout<<"data has been trasmitted";
}
void f_transfer()
{
FILE *f1;
char ch;
f1=fopen("c:\test.txt","w");
while( (ch=getc(f1)) !=EOF)
{
ch=getc(f1);
cout<< ch;
outport(0x3f8,ch);
}
fclose(f1);
ch='0';
outport(0x3f8,ch);
cout<<"file is transmitted \n";
}
}


Source Code at Receiver side:


#include<iostream.h>
#include<dos.h>
#include<io.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
void main()
{
clrscr();
int choice;
cout<<"enter the choice\n";
cout<<"1: character transfer\n";
cout<<"2: string transfer\n";
cout<<"3: file transfer";
cin>>choice;
switch(choice)
{
case 1:
void c_transfer();
break;
case 2:
void s_transfer();
break;
case 3:
void f_transfer();
break;
default:
cout<<"Invalid choice";
}
void c_transfer()
{
char ch;
outport(0x3FB,0x8f);
outport(0x3f8,0x00);
outport(0x3f9,0x24);
outport(0x3f9,0x0f);
ch=inport(0x3f8);
cout<<"the character recieved is"<<ch;
getch();
}
void s_transfer()
{
char s[10];
for(i=0;i<10;i++)
{
outport(0x3FB,0x8f);
outport(0x3f8,0x00);
outport(0x3f9,0x24);
outport(0x3f9,0x0f);
s[i]=inport(0x3f8);
}
cout<<"the string recieved is"<<s;
}
void f_transfer()
{
FILE *f1;
char ch='1','0';
outport(0x3FB,0x8f);
outport(0x3f8,0x00);
outport(0x3f9,0x24);
outport(0x3f9,0x0f);
f1=fopen("c:\test.txt","w");
cout<<"recieving Data<<end;
while(c!='0')
{
ch=inport(0x3f8);
if(a==c)
{
break;
}
cout<<'l';
cout<<ch;
fclose(f1);
cout<<"Data received";
getch();
}


Compilation /Running and Debugging the Solution

• Go to Compile Menu and Press the Compile for the Compilation of the code.
• If Successful Compilation is done then Run the Code Using ctrl + F9 key.
Before Compilation, following steps are to be followed:
• Step 1: Create a folder in either E or F drive with your Id Number or Name Followed by
RollNo.
• Step 2: Start the TC (Turbo C) from Desktop Icon or Go To Directory D:/TC/BIN/ and
run tc.exe . An Editor will be start.
• Step 3: Click on File Menu --> New. New (.cpp) file will be created. Again Click on File
-> Save. A dialog box will open. Write the path to your directory e.g. E:\CCN_Program
\FileName.CPP and Press OK. Now your cpp program will be saved in your directory.
• Step 4: Go To Option->Directories Check That Include Directory is set As D:\TC\Include
and Library Directory is set To D:\TC\LIB

Thursday 25 April 2013

cookie


<html>
<head>
<script type="text/javascript">
function add_cookies()
{
var name=document.f1.t1.value;
dt= new Date();
var mts=dt.getDate(dt) + 1;
dt.setDate(mts);
document.write(dt);
document.cookie="name" + "=" + name + ";expires="+dt.toUTCString();
}
</script>
</head>
<body>
<form name=f1 method=post action=''>
<input type=text name=t1><input type=button onclick='add_cookies()'; value='Add Cookies'>
</form>
<br><br>
<a href=add-cookies.htm>Add Cookies</a> | <a href=read-cookies.htm>Read Cookies</a>
</body>
</html>

food menu


Foodmenu.xml
<?xml version="1.0"?>
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
two of our famous Belgian Waffles with plenty of real maple syrup
</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>
light Belgian waffles covered with strawberries and whipped cream
</description>
<calories>900</calories>
</food>
<food>
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description>
light Belgian waffles covered with an assortment of fresh berries and whipped cream
</description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>
thick slices made from our homemade sourdough bread
</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>
two eggs, bacon or sausage, toast, and our ever-popular hash browns
</description>
<calories>950</calories>
</food>
</breakfast_menu>

catlog


Catalog.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/css" href="exp8_b.css"?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>RCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1982</YEAR>
</CD>
<CD>
<TITLE>Still got the blues</TITLE>
<ARTIST>Gary Moore</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Virgin records</COMPANY>
<PRICE>10.20</PRICE>
<YEAR>1990</YEAR>
</CD>
<CD>
<TITLE>Eros</TITLE>
<ARTIST>Eros Ramazzotti</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>BMG</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1997</YEAR>
</CD>
<CD>
<TITLE>One night only</TITLE>
<ARTIST>Bee Gees</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Polydor</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1998</YEAR>
</CD>
<CD>
<TITLE>Sylvias Mother</TITLE>
<ARTIST>Dr.Hook</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS</COMPANY>
<PRICE>8.10</PRICE>
<YEAR>1973</YEAR>
</CD>
<CD>
<TITLE>Maggie May</TITLE>
<ARTIST>Rod Stewart</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Pickwick</COMPANY>
<PRICE>8.50</PRICE>
<YEAR>1990</YEAR>
</CD>
<CD>
<TITLE>Romanza</TITLE>
<ARTIST>Andrea Bocelli</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>Polydor</COMPANY>
<PRICE>10.80</PRICE>
<YEAR>1996</YEAR>
</CD>
<CD>
<TITLE>When a man loves a woman</TITLE>
<ARTIST>Percy Sledge</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Atlantic</COMPANY>
<PRICE>8.70</PRICE>
<YEAR>1987</YEAR>
</CD>
<CD>
<TITLE>Black angel</TITLE>
<ARTIST>Savage Rose</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>Mega</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1995</YEAR>
</CD>
<CD>
<TITLE>1999 Grammy Nominees</TITLE>
<ARTIST>Many</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Grammy</COMPANY>
<PRICE>10.20</PRICE>
<YEAR>1999</YEAR>
</CD>
<CD>
<TITLE>For the good times</TITLE>
<ARTIST>Kenny Rogers</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Mucik Master</COMPANY>
<PRICE>8.70</PRICE>
<YEAR>1995</YEAR>
</CD>
<CD>
<TITLE>Big Willie style</TITLE>
<ARTIST>Will Smith</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1997</YEAR>
</CD>
<CD>
<TITLE>Tupelo Honey</TITLE>
<ARTIST>Van Morrison</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Polydor</COMPANY>
<PRICE>8.20</PRICE>
<YEAR>1971</YEAR>
</CD>
<CD>
<TITLE>Soulsville</TITLE>
<ARTIST>Jorn Hoel</ARTIST>
<COUNTRY>Norway</COUNTRY>
<COMPANY>WEA</COMPANY>
<PRICE>7.90</PRICE>
<YEAR>1996</YEAR>
</CD>
<CD>
<TITLE>The very best of</TITLE>
<ARTIST>Cat Stevens</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Island</COMPANY>
<PRICE>8.90</PRICE>
<YEAR>1990</YEAR>
</CD>
<CD>
<TITLE>Stop</TITLE>
<ARTIST>Sam Brown</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>A and M</COMPANY>
<PRICE>8.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>Bridge of Spies</TITLE>
<ARTIST>T'Pau</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Siren</COMPANY>
<PRICE>7.90</PRICE>
<YEAR>1987</YEAR>
</CD>
<CD>
<TITLE>Private Dancer</TITLE>
<ARTIST>Tina Turner</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Capitol</COMPANY>
<PRICE>8.90</PRICE>
<YEAR>1983</YEAR>
</CD>
<CD>
<TITLE>Midt om natten</TITLE>
<ARTIST>Kim Larsen</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>Medley</COMPANY>
<PRICE>7.80</PRICE>
<YEAR>1983</YEAR>
</CD>
<CD>
<TITLE>Pavarotti Gala Concert</TITLE>
<ARTIST>Luciano Pavarotti</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>DECCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1991</YEAR>
</CD>
<CD>
<TITLE>The dock of the bay</TITLE>
<ARTIST>Otis Redding</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Atlantic</COMPANY>
<PRICE>7.90</PRICE>
<YEAR>1987</YEAR>
</CD>
<CD>
<TITLE>Picture book</TITLE>
<ARTIST>Simply Red</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>Elektra</COMPANY>
<PRICE>7.20</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Red</TITLE>
<ARTIST>The Communards</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>London</COMPANY>
<PRICE>7.80</PRICE>
<YEAR>1987</YEAR>
</CD>
<CD>
<TITLE>Unchain my heart</TITLE>
<ARTIST>Joe Cocker</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>EMI</COMPANY>
<PRICE>8.20</PRICE>
<YEAR>1987</YEAR>
</CD>
</CATALOG>
Catalog.css
CATALOG
{
background-color: #ffffff;
width: 100%;
}
CD
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
}
TITLE
{
color: #FF0000;
font-size: 20pt;
}
ARTIST
{
color: #0000FF;
font-size: 20pt;
}
COUNTRY,PRICE,YEAR,COMPANY
{
display: block;
color: #000000;
margin-left: 20pt;
}

asp response


Form_response.asp
<html>
<head>
<title>Responding to a form</title>
</head>
<body>
Your name is <% =Request.Form("name") %> <BR>
Your email is <% =Request.Form("email") %>
</body>
</html>
Form_response.html
<html>
<head>
<title>Asking for information</title>
</head>
<body>
<form method="post" action="form_response.asp">
Your name: <input type="text" name="name" size="20"><BR>
Your email: <input type="password" name="email" size="15"><BR>
<input type="Submit" value="Submit">
</form>
</body>
</html>

session


Session.asp
<html>
<body>

<%
response.write("<p>")
response.write("Default Timeout is: " & Session.Timeout & " minutes.")
response.write("</p>")

Session.Timeout=30

response.write("<p>")
response.write("Timeout is now: " & Session.Timeout & " minutes.")
response.write("</p>")
%>

</body>
</html>
Index.asp
<html>
<head>
<title>Responding to a form</title>
</head>
<body>
Your name is <% =Request.Form("name") %> <BR>
Your email is <% =Request.Form("email") %>
</body>
</html>
Page1.asp
<% IF Session("permission")="YES" THEN %>
<html>
<title>Page 1</title>
<body>

Hi <% =Session("username") %>, welcome to Page 1 <BR>
This page is empty at the moment, but it will be very interesting in the next future

</body>
</html>

<% ELSE %>

You are not allowed to access this page

<% end IF %>
Respondtoform.asp
<% IF Request.form="" THEN %>
<html>
<title>Our private pages</title>
<body>
In order to access this pages fill the form below:<BR>
<form method="post" action="index.asp">
Username: <input type="text" name="username" size="20"><BR>
Password: <input type="password" name="password" size="15"><BR>
<input type="Submit" value="Submit">
</form>
</body>
</html>

<% ELSE %>

<%
IF Request.form("username")="Joe" AND Request.form("password")="please" THEN
%>
<%
Session("permission")="YES"
Session("username")="Joe"
%>

<html>
<title>Our private pages</title>
<body>

Hi <% =Session("username") %>, you are allow to see these pages: <BR>
<A HREF="page1.asp">Page 1</A><BR>
<A HREF="page2.asp">Page 2</A>

</body>
</html>

<% ELSE %>

Error in username or password

<% END IF %>

<% END IF %>

form validation


Form validation
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<title>JavaScript Form Validation using a sample registration form</title>
<meta name="keywords" content="example, JavaScript Form Validation, Sample registration form" />
<meta name="description" content="This document is an example of JavaScript Form Validation using a sample registration form. " />
<link rel='stylesheet' href='js-form-validation.css' type='text/css' />
<script src="sample-registration-form-validation.js"></script>
</head>
<body onLoad="document.registration.userid.focus();">
<h1>Registration Form</h1>
<p>Use tab keys to move from one input field to the next.</p>
<form name='registration' onSubmit="return formValidation();">
<ul>
<li><label for="userid">User id:</label></li>
<li><input type="text" name="userid" size="12" /></li>
<li><label for="passid">Password:</label></li>
<li><input type="password" name="passid" size="12" /></li>
<li><label for="username">Name:</label></li>
<li><input type="text" name="username" size="50" /></li>
<li><label for="address">Address:</label></li>
<li><input type="text" name="address" size="50" /></li>
<li><label for="country">Country:</label></li>
<li><select name="country">
<option selected="" value="Default">(Please select a country)</option>
<option value="AF">Australia</option>
<option value="AL">Canada</option>
<option value="DZ">India</option>
<option value="AS">Russia</option>
<option value="AD">USA</option>
</select></li>
<li><label for="zip">ZIP Code:</label></li>
<li><input type="text" name="zip" /></li>
<li><label for="email">Email:</label></li>
<li><input type="text" name="email" size="50" /></li>
<li><label id="gender">Sex:</label></li>
<li><input type="radio" name="sex" value="Male" /><span>Male</span></li>
<li><input type="radio" name="sex" value="Female" /><span>Female</span></li>
<li><label>Language:</label></li>
<li><input type="checkbox" name="en" value="en" checked /><span>English</span></li>
<li><input type="checkbox" name="nonen" value="noen" /><span>Non English</span></li>
<li><label for="desc">About:</label></li>
<li><textarea name="desc" id="desc"></textarea></li>
<li><input type="submit" name="submit" value="Submit" /></li>
</ul>
</form>
</body>
</html>

Style.css
h1 {
margin-left: 70px;
}
form li {
list-style: none;
margin-bottom: 5px;
}

form ul li label{
float: left;
clear: left;
width: 100px;
text-align: right;
margin-right: 10px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:14px;
}

form ul li input, select, span {
float: left;
margin-bottom: 10px;
}

form textarea {
float: left;
width: 350px;
height: 150px;
}

[type="submit"] {
clear: left;
margin: 20px 0 0 230px;
font-size:18px
}

p {
margin-left: 70px;
font-weight: bold;
}

splitting names


Splitting name.. javascript
<html>
 <head>
  <title> Experiment No 6(c 1) </title>

<script type="text/javascript">
function SplitName()
{
var myName = prompt("Enter Your complete name: ");
var mySplitName = myName.split(" ");
for(i = 0; i < mySplitName.length; i++)
{
document.write("<br />*** " +mySplitName[i]+"*** having length of "+ mySplitName[i].length + "characters");
}
}
</script>
 </head>

 <body>
  <center>
<h5>Implement a javascript  by using string object enter a complete name ,find out the length of string & 1st name ,last name & middle name</h5>
<form>
<input type="button" value="Split My Name" onclick="SplitName()">
</form>
  </center>
 </body>
</html>

gm ge gn


Print GM a/c to date n time
<html>
 <head>
  <title> Experiment No 6(c 2) </title>
 </head>

 <body>
  <center>
<h5>Implement a javascript  by using date object print GOOD MORNING as per the current date or time.display complete date </h5>

<form>
<input type="button" value="Display" onclick="disp()">

<script type="text/javascript">
function disp()
{
var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10)
{
minutes = "0" + minutes
}
document.write("<h4>It is now "+ hours + ":" + minutes + " ")

if(hours > 11)
{
document.write("PM")
}
else
{
document.write("AM")
}
if (minutes <= 59 && hours < 12 )
{
document.write("<h1>Good Marning !!!!!!! </h1>")
}
else if (minutes <= 59 && hours > 12 && hours < 16 )
{
document.write("<h1>Good Afternoon !!!!!!! </h1>")
}
else if (minutes <= 59 && hours > 16 && hours <= 23 )
{
document.write("<h1>Good Evening !!!!!!! </h1>")
}
}
</script>

</form>
  </center>
 </body>
</html>

leap and minor


<html>
<head>

</head>

<body>
<H1 align="center">Check for the Person is He/ She minor? </h1>
<button onclick="minor()">Check for Minor</button>
<button onclick="leap()">Check for Leap year</button>
<script type="text/javascript">
<!--
function minor()
{
var name = prompt("Please enter your name"," ")
var age = prompt("Please enter your age"," ")
if(age < 18 )
alert(name + " is MINOR");
else
alert(name + " is NOT MINOR");
}
function leap()
{
var year = prompt("Please enter year to chech is Leap year or not"," ")
var temp = year % 4

if(temp == 0 )
alert(year + " is LEAP");
else
alert(year + " is NOT LEAP");
}
-->
</script>

</body>
</html>

marks calculator


<html>
<head>

</head>
<body>

<center><h1>Marks Calculation</h1></center>
<script>
<!--
    var n,sum,sub,mark,out,per,tot,res,i,d;
    p=0;
    n=0;
    mark=0;
    out=0;
    tot=0;
    sum=0;
    per=0;
    i=1;

    n=parseInt(prompt("Enter the no. of subject for  you  to see the result:"));
    while(i<=n)
    {
        sub=prompt("enter the subject name:");
        document.write("enter the subject name:");
        document.write(sub);
        mark=parseInt(prompt("enter the marks obtained:"));
        document.write(" marks obtained:");
        document.write(mark);
        out=parseInt(prompt("enter the marks out off:"));
        document.write(" marks out off:");
        document.write(out);
        document.write("&lt;br&gt;");
        i++;
        sum=sum+mark;
        tot=tot+out;
    }
    document.write("TOTAL:");
    document.write(tot);
    document.write("TOTAL MARKS OBTAINED:");
    document.write(sum);
    per=parseFloat(sum/tot*100);
    document.write("PERCENTAGE OBTAINED:");
    document.write(per);

-->
</script>
</body>
</html>

calculator


<html>
<head>
<title>Simple Javascript Calculator - Basic Arithmetic Operations</title>
<script language="javascript" type="text/javascript">
function multiply(){
a=Number(document.calculator.number1.value);
b=Number(document.calculator.number2.value);
c=a*b;
document.calculator.total.value=c;
}
</script>

<script language="javascript" type="text/javascript">
function addition(){
a=Number(document.calculator.number1.value);
b=Number(document.calculator.number2.value);
c=a+b;
document.calculator.total.value=c;
}
</script>

<script language="javascript" type="text/javascript">
function power(){
a=Number(document.calculator.number1.value);
b=Number(document.calculator.number2.value);
c=Math.pow(a, b);
document.calculator.total.value=c;
}
</script>

<script language="javascript"type="text/javascript">
function Sqrt()
{
a=Number(document.calculator.number1.value);
c=Math.sqrt(a);
document.calculator.total.value=c;
}
</script>

<script language="javascript" type="text/javascript">
function subtraction(){
a=Number(document.calculator.number1.value);
b=Number(document.calculator.number2.value);
c=a-b;
document.calculator.total.value=c;
}
</script>

<script language="javascript" type="text/javascript">
function division(){
a=Number(document.calculator.number1.value);
b=Number(document.calculator.number2.value);
c=a/b;
document.calculator.total.value=c;
}
</script>

<script language="javascript" type="text/javascript">
function modulus(){
a=Number(document.calculator.number1.value);
b=Number(document.calculator.number2.value);
c=a%b;
document.calculator.total.value=c;
}
</script>

</head>

<body>

<!-- Opening a HTML Form. -->
<form name="calculator">

<!-- Here user will enter 1st number. -->
Number 1: <input type="text" name="number1">

<!-- Here user will enter 2nd number. -->
Number 2: <input type="text" name="number2">

<!-- Here result will be displayed. -->
Get Result: <input type="text" name="total">

<!-- Here respective button when clicked, calls only respective artimetic function. -->
<input type="button" value="ADD" onclick="javascript:addition();">
<input type="button" value="SUB" onclick="javascript:subtraction();">
<input type="button" value="MUL" onclick="javascript:multiply();">
<input type="button" value="DIV" onclick="javascript:division();">
<input type="button" value="MOD" onclick="javascript:modulus();">
<input type="button" value="POW" onclick="javascript:power();">
<input type="button" value="Sqrt" onclick="javascript:Sqrt();">
</form>

</body>
</html>

inline css


<html>

<body>
<h4>Introduction</h4>
<p class="capitalise">Electromagnetic radiation (EM radiation or EMR) is a form of energy emitted and absorbed by charged particles which exhibits wave-like behavior as it travels through space. EMR has both electric and magnetic field components, which stand in a fixed ratio of intensity to each other, and which oscillate in phase perpendicular to each other and perpendicular to the direction of energy and wave propagation. In a vacuum, electromagnetic radiation propagates at a characteristic speed, the speed of light.
</p>
<h4>History</h4>
<p style="background-image:url('Koala.jpg');

    background-repeat:no-repeat;

    background-position:bottom;

    margin-bottom:1000px;

     font-family:Arial;
     font-size:40px;">

Electromagnetic radiation is a particular form of the more general electromagnetic field (EM field), which is produced by moving charges. Electromagnetic radiation is associated with EM fields that are far enough away from the moving charges that produced them that absorption of the EM radiation no longer affects the behavior of these moving charges. These two types or behaviors of EM field are sometimes referred to as the near and far field. In this language, EMR is merely another name for the far-field. Charges and currents directly produce the near-field. However, charges and currents produce EMR only indirectly—rather, in EMR, both the magnetic and electric fields are associated with changes in the other type of field, not directly by charges and currents. This close relationship assures that the electric and magnetic fields in EMR exist in a constant ratio of strengths to each other, and also to be found in phase, with maxima and nodes in each found at the same places in space.
</p>
</body>




</html>        

external css


<html>
<head>
<link rel=stylesheet type=text/css href="p.css">
</head>
<body>
<h1>INTRODUCTION</h1>
<p>
The Universe is commonly defined as the totality of existence,[1][2][3][4] including planets, stars, galaxies, the contents of intergalactic space, and all matter and energy.[5][6] Definitions and usage vary[how?] and similar terms include the cosmos, the world and nature.

Scientific observation of the Universe, the observable part of which is about 93 billion light years in diameter,[7] has led to inferences of its earlier stages. These observations suggest that the Universe has been governed by the same physical laws and constants throughout most of its extent and history. The Big Bang theory is the prevailing cosmological model that describes the early development of the Universe, which in physical cosmology is believed to have occurred about 13.77 billion years ago.[8]

There are various multiverse hypotheses, in which physicists have suggested that the Universe might be one among many universes that likewise exist.[9][10] The farthest distance that it is theoretically possible for humans to see is described as the observable Universe. Observations have shown that the Universe appears to be expanding at an accelerating rate, and a number of models have arisen to predict its ultimate fate.

</p>
<h2>HISTORY</h2>
<p>Throughout recorded history, several cosmologies and cosmogonies have been proposed to account for observations of the Universe. The earliest quantitative geocentric models were developed by the ancient Greek philosophers. Over the centuries, more precise observations and improved theories of gravity led to Copernicus's heliocentric model and the Newtonian model of the Solar System, respectively. Further improvements in astronomy led to the realization that the Solar System is embedded in a galaxy composed of billions of stars, the Milky Way, and that other galaxies exist outside it, as far as astronomical instruments can reach. Careful studies of the distribution of these galaxies and their spectral lines have led to much of modern cosmology. Discovery of the red shift and cosmic microwave background radiation suggested that the Universe is expanding and had a beginning </p>
</body>
</html>


external.css

body{
              background-image:url('u.jpg') ;
              background-repeat:repeat;
               background-position: center;
              font-family:Times New Roman ;
              font-size:30px;
           }
p{
     text-align:center;
     color:white;
     text-indent:30px ;
  }
h1{
       text-align:center;
       color:REd;
       font-family:Times New Roman;
      }
h2{
       text-align:center;
       color:green;
       font-family:Times New Roman;
      }

frameset


framec.html

<html>
<head>
<title>frames</title>
</head>
<body bgcolor=" #FFEBEB">

</body>
</html>

-------------------------------------

frameset.html

<html>
<head>
<title>Frames</title>
</head>
<frameset rows="15%,*"">
  <frame src="frame_a.html" name=""f1">

<frameset cols="25%,75%">
  <frame src="frame_b.html" name="f2">
  <frame src="frame_c.html" name="f3">
</frameset>
</frameset>
</html>

----------------------
frameb.html

<html>
<head>
<title>frames</title>
</head>
<body bgcolor=" #00FFFF">
<center>
<h2>Practicals Programs List<h2>
</center>
<a href="SEIT_timetable.html" target="f3">1.Time Table</a> <br>
<a href="resume.html" target="f3">2. Resume</a> <br>
<a href="form1.html" target="f3">3. Addmision</a> <br>
<a href="frameset.html" target="f3">4. Frameset</a> <br>
</body>
</html>
--------------------

framea.html

<html>
<head>
<title>frames</title>
</head>
<body bgcolor=" #FFCC66">
<center>
<h1>Internet Programing<h1>
<h2>Practicals<h2>
</center>
</body>
</html>

registration form



<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>
<center><img src="C:\Users\DINKAR\Desktop\Form\mgm.jpg" height="60" width="60"></center>
<center><h1>MGM College Of Engineering & Technology</h1></center></img>
<center><h2><font color="red"> <u> APPLICATION FOR ADDMISSION</u> </font></h2><br>
REV.  <input type="checkbox" name="rev">&nbsp;&nbsp;&nbsp
Mr.   <input type="checkbox" name="mr">&nbsp;&nbsp;&nbsp
Mrs.  <input type="checkbox" name="mrs">&nbsp;&nbsp;&nbsp
Miss  <input type="checkbox" name="miss">&nbsp;&nbsp;&nbsp
Ms.   <input type="checkbox" name="ms"> </center><br>
<pre>
<font face="Times New Roman" size="4">
Surname : <input type="text" name="sname" size="40">        Firstname :   <input type="text" name="fname" size="40">

Date of Birth : DD <input type="text" name="dd" size="2">  MM <input type="text" name="mm" size="2"> YY <input type="text" name="yy" size="4">
<hr noshade color="black" align="center" width="90%" size="4">
<u><b><big> Address for correspondence:</big></b></u>
Street name and number :               <input type="text" name="street" size="110">
   
Suburb :    <input type="text" name="suburb" size="25">                      State :     <input type="text" name="state" size="23">                Post Code :  <input type="text" name="pcode" size="25">

country :    <input type="text" name="country" size="25">                     Email :    <input type="text" name="email" size="82">

Tel.Home : <input type="text" name="home" size="25">                    Buisness : <input type="text" name="state" size="25">               Fax :         <input type="text" name="state" size="25">
<hr noshade color="black" align="center" width="90%" size="4">
<b><u><big>Secondary school studies :-</big></u></b>
<textarea cols="118" rows="8"></textarea>


<big><b><u>Univercity,college, institute, etc.,studies :-</u></b></big>
<textarea cols="118" rows="12"></textarea>


<hr noshade color="black" align="center" width="90%" size="4">

<b><u>Declaration :-</u></b>
I declare that the information submitted above is correct and complete.

Student signature :     <textarea cols="37" rows="2"></textarea> Date : <input type="text" name="date" size="25">



<hr align="center" width="90%" color="black">
</font>
</pre>
</div>
</body></html>

time table


Timetable

<html>
<head>
<title> SEIT Timetable </title>
</head>
<body>
<table border="0" align=center>
<td align=center><img src="mgm_logo.png" alt="MGM logo" height="75" width="75"  align="middle"></td>
</table>
<MARQUEE   height=55 weight="80%" align=middle bgcolor=yellow><font size="10" color="red">MGM CET</font><BR>
          </MARQUEE>

<BR>
<h1 align=middle>SEIT CLASS TIMETABLE </h1>

<table border="1" align=center>
 <tr>
 <th align=center>Day/Time</th>
 <th align=center>&nbsp </th>
 <th align=center>08.30-09.30</th>
<th align=center>09.30-10.30</th>
<th align=center>10.30-11.30</th>
<th align=center>11.30-12.30</th>
<th align=center>12.30-13.00</th>
<th align=center>13.00-14.00</th>
<th align=center>14.00-15.00</th>
<th align=center>15.00-16.00</th>
<th align=center>16.00-17.00</th>
</tr>
 <tr >
 <td rowspan=3 align=center>Monday</td>
 <td align=center>Subject</td>
 <td align=center>FAM(T)</td>
 <td align=center>CM(L)</td>
 <td align=center>NTDD(L)</td>
<td align=center rowspan=3>OL</td>
<td align=center rowspan=16></td>
<td align=center>PCOM(L)</td>
<td align=center>MPMC(L)</td>
<td align=center colspan=2>PCOM/MPMC(P)</td>
</tr>
 <tr>
<td align=center> Faculty</td>
 <td align=center> YJ</td>
 <td align=center> DBP</td>
 <td align=center> DS</td>
<td align=center> NLB</td>
<td align=center>ES</td>
<td COLSPAN=2 align=center> NLB/RS</td>
</tr>
 <tr>
<td align=center> Room/Lab</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
<td align=center> 213</td>
<td align=center> 213</td>
<td COLSPAN=2 align=center> Lab-1/ Lab-2</td>
</tr>




 <tr >
 <td rowspan=3 align=center>Tuesday</td>
 <td align=center>Subject</td>
 <td align=center>PCOM(L)</td>
 <td align=center>CM(T)</td>
 <td align=center>MPMC(L)</td>
<td align=center >NTDT(L)</td>

<td align=center>FAM(L)</td>
<td align=center ROWSPAN=3>OL</td>
<td align=center colspan=2>MPMC/PCOM(P)</td>
</tr>
 <tr>
<td align=center> Faculty</td>
 <td align=center> YJ</td>
 <td align=center> DBP</td>
 <td align=center> DS</td>
<td align=center> NLB</td>
<td align=center>ES</td>
<td COLSPAN=2 align=center> NLB/RS</td>
</tr>
 <tr>
<td align=center> Room/Lab</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
<td align=center> 213</td>
<td align=center> 213</td>
<td COLSPAN=2 align=center> Lab-1/ Lab-2</td>
</tr>




<tr >
 <td rowspan=3 align=center>Wednesday</td>
 <td align=center>Subject</td>
 <td align=center>FAM(L)</td>
 <td align=center>MPMC(L)</td>
 <td align=center>NTDT(L)</td>
<td align=center >IP(L)</td>

<td align=center>CM(L)</td>
<td align=center >FAM(T)</td>
<td align=center colspan=2 ROWSPAN=3>OL</td>
</tr>
 <tr>
<td align=center> Faculty</td>
 <td align=center> YJ</td>
 <td align=center> ES</td>
 <td align=center> DS</td>
<td align=center> KM</td>
<td align=center>DBP</td>
<td align=center> YJ</td>
</tr>
 <tr>
<td align=center> Room/Lab</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
<td align=center> 213</td>
<td align=center> 213</td>
<td align=center> 213</td>
</tr>




<tr >
 <td rowspan=3 align=center>Thursday</td>
 <td align=center>Subject</td>
 <td align=center>PCOM(L)</td>
 <td align=center>CM(L)</td>
 <td align=center>NTDD(L)</td>
<td align=center>FAM(L)</td>
<td align=center COLSPAN=4 >IP/NTDD(P)</td>

</tr>
 <tr>
<td align=center> Faculty</td>
 <td align=center> NLB</td>
 <td align=center> DBP</td>
 <td align=center> DS</td>
<td align=center> YJ</td>
<td align=center COLSPAN=4 > KM/AY</td>

</tr>
 <tr>
<td align=center> Room/Lab</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
<td align=center> 213</td>
<td align=center COLSPAN=4 > LAB-1/ LAB-2</td>
</tr>


<tr >
 <td rowspan=3 align=center>FRIDAY</td>
 <td align=center>Subject</td>
 <td align=center>PCOM(L)</td>
 <td align=center>CM(L)</td>
 <td align=center>MPMC(L)</td>
<td align=center>IP(L)</td>
<td align=center COLSPAN=4 >NTDD/IP(P)</td>

</tr>
 <tr>
<td align=center> Faculty</td>
 <td align=center> NLB</td>
 <td align=center> DBP</td>
 <td align=center> ES</td>
<td align=center> KM</td>
<td align=center COLSPAN=4 > AY/KM</td>

</tr>
 <tr>
<td align=center> Room/Lab</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
 <td align=center> 213</td>
<td align=center> 213</td>
<td align=center COLSPAN=4 > LAB-1/ LAB-2</td>

</tr>



</table>



</body>
</html>

resume


Resume
<html>
<head>
</head><body>



<div>
<h4>NAME :</h4><br>
<h4>Address :</h4><br>
<hr>
<table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Objective </b></td>
</tr>
</table><br>
To join an organization that will recognize and utilize my skills fully and offer me a position requiring innovative and creative ideas where continuous growth and learning are way of life<br><br>
<table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Academic Record </b></td>
</tr>
</table>
<table width="10%" border="1">
<tr>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Class/Course </b></td>
</tr>
</table></th>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Name of the Institution </b></td>
</tr>
</table></th>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>University/Board of Study </b></td>
</tr>
</table></th>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Year of Passing </b></td>
</tr>
</table></th>
</tr>
<tr>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>B.E. Mechanical Engineering </b></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th></tr>
<tr>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>H.Sc. </b></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th></tr>
<tr>
<th align="center"><table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>S.S.L.C.</b></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th>
<th align="center"><table width="100%">
<tr>
<td></td>
</tr>
</table></th></tr>
</table>
<table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Additional Qualification</b></td>
</tr>
</table><br>
<ul type="disc">
<li>Studied AutoCad</li>
</ul>
<table bgcolor="#FFC0CB" width="100%" border="1">
<tr>
<td><b>Key Skills </b></td>
</tr>
</table><br>
<ul type="disc">
<li>Major factor for maintainance of relationship with key people and behaviour</li>
<li>Extremely successful and maintaining relationship with people through regular meeting</li>
</ul>
</div>

</body></html>

Sunday 21 April 2013

IMPORTANT QUESTIONS FOR NTDD VIVA.





What are the different layers in OSI model ?2.

What are the different layers in TCP/IP model ?3.

Difference between OSI & TCP/IP reference model.4.

What is the advantage of layering ?5.

Difference between packet and circuit switching ?6.

What are the functions of data link layer ?7.

What is ALOHA ?8.

Slotted aloha.9.

Difference between Aloha & Slotted Aloha.10.

CSMA/CD.11.

Bit stuffing.12.

Even parity and odd parity examples.13.

Hamming code examples.14.

What is CRC ?15.

What is flow control ?16.

Explain stop & wait protocol.17.

Sliding window protocol.18.

What is token bus & token ring.19.

Time Division Multiplexing (TDM) & Frequency Division Multiplexing (FDM).20.

What is the maximum size of frame ?21.

What is the maximum size of packet ?22.

What is routing ?23.

What is congestion ?24.

Difference between congestion control & flow control.25.

What is subnet ?26.

What is TCP segment header size.27.

What is three way handshaking.28.

Hub ; Bridge ; Switch (Definition & difference).29.

What is distributed computing.30.

Difference between Distributed & centralized computing.31.

What is the remote procedure call ?32.

Difference between public key & private key.33.

Leaky bucket algorithm.34.

Difference between IPV4 & IPV6.35.

SNMP, OSPF, ARP, RARP, BGP, ICMP, BOOTP