Showing posts with label WTAD. Show all posts
Showing posts with label WTAD. Show all posts

Sunday, 23 June 2013

16. Assume that the information regarding the marks for all the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.

0 comments
WTAD Practical - 16
Assume that the information regarding the marks for all the subjects of a student in
the last exam are available in a database, Develop a Servlet which takes the
enrollment number of a student as a request parameter and displays the marksheet for the student.
index.html


<HTML>
<HEAD>
<TITLE>WTAD.practical-16 @iAmLearningHere </TITLE>

</HEAD>
<BODY bgcolor="YellowGreen">
<h3> Result  </h3>
<hr>
<form name="frm1" action="display">
Enter Enrolment No :: <input type="text" name="en"> 
<input type="submit" Value="Get Result"">
</form>
</BODY>
</HTML>

Saturday, 22 June 2013

15. Assume that we have got three pdf files for the MCA-1 Syllabus, MCA-2 Syllabus and MCA-3 Syllabus respectively, Now write a Servlet which displays the appropriate PDF file to the client, by looking at a request parameter for the year (1, 2 or 3).

1 comments
WTAD Practical - 15
Write a Servlet to display parameters available on request.
index.html


<HTML>
<HEAD>
<TITLE>WTAD.practical-15 @iAmLearningHere </TITLE>
</HEAD>
<BODY bgcolor="YellowGreen">
<h3>DISPLAY Syllabus in pdf</h3>
<hr>
<form name="f1" action="display" method="get" >
MCA-1<br>
MCA-2<br>
MCA-3<br>
<input type="text" name="MCA" value="" />
<input type="submit" value="Show Syllabus" />
</form>
</BODY>
</HTML>

14. Write a Servlet which displays a message and also displays how many times the message has been displayed (how many times the page has been visited).

0 comments
WTAD Practical - 14
Write a Servlet which displays a message and also displays how many times the
message has been displayed (how many times the page has been visited).
WEB-INF/web.xml


<web-app>
<servlet>
<servlet-name>s14</servlet-name>
<servlet-class>VisitCount</servlet-class>
</servlet>
<!-- Servlet Mapping -->
<servlet-mapping>
<servlet-name>s14</servlet-name>
<url-pattern>/visit</url-pattern>
</servlet-mapping>
</web-app>

12. Write a Servlet to display parameters available on request.

0 comments
WTAD Practical - 12
Write a Servlet to display parameters available on request.
index.html


<HTML>
<HEAD>
<TITLE>WTAD.practical-12 @iAmLearningHere </TITLE>
</HEAD>
<BODY bgcolor="YellowGreen">
<h3>Display parameters available on request.</h3>
<hr>
<form name="f1" action="display" method="get" >
<!-- Enter Three Parameters Here -->
Source Name:<input type="text" name="nm"/><br />
Subject 1 &nbsp;&nbsp;&nbsp; : <input type="text" name="sub1" /><br />
Subject 2 &nbsp;&nbsp;&nbsp; : <input type="text" name="sub2" /><br />

<input type="submit" value="Send Parameters" />
</form>
</BODY>
</HTML>

Friday, 21 June 2013

11. Write a Servlet to display all the headers available from request.

1 comments
WTAD Practical - 11
Write a Servlet to display all the headers available from request.
WEB-INF/web.xml


<web-app>
<servlet>
<servlet-name>s11</servlet-name>
<servlet-class>RequestHeaders</servlet-class>
</servlet>
<!-- Servlet Mapping -->
<servlet-mapping>
<servlet-name>s11</servlet-name>
<url-pattern>/requestheaders</url-pattern>
</servlet-mapping>
</web-app>

10.Write a Servlet to display “Hello World” on browser.

0 comments
WTAD Practical - 10
Write a Servlet to display “Hello World” on browser.
WEB-INF/web.xml


<web-app>
<servlet>
<servlet-name>s10</servlet-name>
<servlet-class>Hello</servlet-class>
</servlet>
<!-- Servlet Mapping -->
<servlet-mapping>
<servlet-name>s10</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>

Monday, 17 June 2013

9. Write a JavaScript to show a pop up window with a message Hello and background color lime and with solid black border.

0 comments
WTAD Practical - 9
Write a JavaScript to show a pop up window with a message Hello and background
color lime and with solid black border.




<HTML>
<html>
<HEAD>
<TITLE>WTAD.practical-9 @iAmLearningHere </TITLE>
</HEAD>
<body bgcolor="YellowGreen">
    <form name="f1">
            <input type="button" value="Pop Up"    onclick="window.open('w1.html','PopUpWindow','width=2s00',
            'height=50')">
    </form>
</body>
</HTML>

8. Write a JavaScript to find a string from the given text. If the match is found then replace it with another string.

0 comments
WTAD Practical - 8
Write a JavaScript to find a string from the given text. If the match is found then
replace it with another string.




<HTML>
<html>
<HEAD>
<TITLE>WTAD.practical-8 @iAmLearningHere </TITLE>
</HEAD>
<body bgcolor="YellowGreen">
        <font size="4">
        <script language="javascript" type="text/javascript">
        var c = prompt("Enter Text :");
        var searchtxt = prompt("Enter Search Text :");
        document.write("<br>Text is :: " + c );
        document.write("<br>Search text is :: " + searchtxt);
        var r = new RegExp(searchtxt);
        if ( c.search() == -1)
        {
            alert("Match Not Found");
            var searchtxt = prompt("Enter Search Text Again:");
        }
        else
        {
            alert("Match Found !");
            var rtext = prompt("Enter  Text To replace With:");
            document.write("<br>Replace text is :: " + rtext);
            document.write("<br>Replaced Text :: " + c.replace(r,rtext));
        }
    </script>
    </body>
</HTML>

7. Write a JavaScript to convert Celsius to Fahrenheit.

0 comments
WTAD Practical - 7
Write a JavaScript to generate two random numbers and find out maximum and
minimum out of it.




<HTML>
<html>
<HEAD>
<TITLE>WTAD.practical-7 @iAmLearningHere </TITLE>
</HEAD>
<body bgcolor="YellowGreen">
        <center><font size=5>
        <script language="JavaScript">
            var a,b;
            a=parseFloat(prompt("enter the Celsius:",""));
            document.write("Celsius value is: "+a+"<br><br>");
            b=32+(a*1.8);
            alert("Celsius to Fehrenheit "+b);
            document.write("Fehrenheit value is: "+b);
        </script>
    </body>
</HTML>

6. Write a JavaScript to remove the highest element from the array and arrange the array in ascending order.

0 comments
WTAD Practical - 6
 Write a JavaScript to remove the highest element from the array and arrange the array in ascending order.

<HTML>
<html>
<HEAD>
<TITLE>WTAD.practical-6 @iAmLearningHere </TITLE>
</HEAD>
<BODY bgcolor="YellowGreen">
    <script language="JavaScript">
            var i,size,j,temp;
            var arr=new Array();
            size=parseInt(prompt("enter the size of array",""));
            for(i=0;i<size;i++)
            {
                arr[i]=parseInt(prompt("enter the element of array",""));
            }
            document.write("array is:-<br>");
            for(i=0;i<size;i++)
            {
                document.write(arr[i]+", ");
            }
            for(i=0;i<size;i++)
            {
                for(j=i+1;j<size;j++)
                {
                    if(arr[i]>arr[j])
                    {
                        temp=arr[i];
                        arr[i]=arr[j];
                        arr[j]=temp;
                    }
                }
            }
            document.write("<br><br>sorted array is:-<br>");
            for(i=0;i<size;i++)
            {
                document.write( arr[i] + ", ");
            }
            document.write("<br><br>after delete large element array is:-<br>");
            arr.pop();
            for(i=0;i<arr.length;i++)
            {
                document.write(arr[i]+", ");
            }
        </script>
</BODY>
</HTML>

Monday, 15 April 2013

5. Write a JavaScript to generate two random numbers and find out maximum and minimum out of it.

0 comments
WTAD Practical - 5
Write a JavaScript to generate two random numbers and find out maximum and
minimum out of it.




<HTML>
<HEAD>
<TITLE>WTAD.practical-5 @iAmLearningHere </TITLE>
</HEAD>

<script type="text/javascript">
    function calculateRandom()
    {
        var r1=Math.floor(Math.random()*100);
        var r2=Math.floor(Math.random()*100);
        document.write('<br>Random No.1 : ' + r1);
        document.write('<br>Random No.2 : ' + r2);
        if (r1 < r2)
        {
            document.write('<br><br>Minimum No.:' + r1);
            document.write('<br>Maximum No.:' + r2);
        }
        else
        {
            document.write('<br><br>Minimum No.:' + r2);
            document.write('<br>Maximum No.:' + r1);
        }
    }
</script>

Sunday, 14 April 2013

4. Write a JavaScript that finds out multiples of 10 in 0 to 10000. On the click of button start the timer and stop the counter after 10 seconds. Display on the screen how many multiples of 10 are found out within stipulated time.

0 comments
WTAD Practical-4
Write a JavaScript that finds out multiples of 10 in 0 to 10000. On the click of button
start the timer and stop the counter after 10 seconds. Display on the screen how
many multiples of 10 are found out within stipulated time.



<HTML>
<HEAD>
<TITLE>WTAD.practical-4 @iAmLearningHere </TITLE>
</HEAD>

<script type="text/javascript">
    function start()
    {
        setTimeout("displayMultiple()", 10000); // time in millisecond
    }

    function displayMultiple()  
    {
        var i = 1;
        document.write(" [ ");
        for(i=1; i<=10000; i++)
        {
            if(i%10==0 )
                document.write(i + ' , ');
        }
        document.write(" ] ");
    }
</script>

Saturday, 13 April 2013

3. Create a Form in HTML with two fields, minimum and maximum, write JavaScript to validate that only numeric value is entered in both, and the value entered in minimum is less than the value entered in maximum.

0 comments
WTAD Practicals :

Create a Form in HTML with two fields, minimum and maximum, write JavaScript
to validate that only numeric value is entered in both, and the value entered in
minimum is less than the value entered in maximum.

<HTML>
<HEAD>
<TITLE>WTAD.practical-3 @iAmLearningHere </TITLE>
</HEAD>
<BODY>
<script type="text/javascript">
    function isValidNum(num)
    {
        if(isNaN(num.value))
            alert("plz enter valid number!!");
        num.focus();
    }
  
    function check()
    {
        var num1 = document.getElementsByName("txtmin")[0].value;
        var num2 = document.getElementsByName("txtmax")[0].value;
        if( num1 < num2 )
            document.getElementById("msg").innerHTML=" Minimum is less than Maximum. OK!";
        else
            document.getElementById("msg").innerHTML="Wrong Entry!!";       
    }
</script>

Friday, 12 April 2013

2. Write a JavaScript that demonstrates the use of +=,-=,*=,/= operators.

0 comments
WTAD Practical-2
Write a JavaScript that demonstrates the use of +=,-=,*=,/= operators.


<HTML>
<HEAD>
<TITLE>WTAD.practical-2 @iAmLearningHere </TITLE>
</HEAD>
<BODY>
<H2>Demonstration the use of +=,-=,*=,/= operators.</H2>
<H3>
<script type="text/javascript">

    var i = 11;
    document.write("<br> i = " + i);
    i += 10;
    document.write("<br>( i +=10 ) =>" + i);
    i *= 10;
    document.write("<br>( i *=10 ) =>" + i);
    i -= 10;
    document.write("<br>( i -=10 ) =>" + i);
    i /= 10;
    document.write("<br>( i /=10 ) =>" + i);
</script>

Thursday, 11 April 2013

1. Write a JavaScript that shows how a variable’s type can be changed on-the-fly.

0 comments
WTAD Practical -1 :
Write a JavaScript that shows how a variable’s type can be changed on-the-fly.


<HTML>
<HEAD>
<TITLE>WTAD.practical-1 @iAmLearningHere </TITLE>
</HEAD>
<BODY>

<H4>See the Variable Type is changing .. !!</H4>
<script type="text/javascript">
    var p1 = 11;
    document.write("<br>p1 contains ::"+ p1 +" of Type :: "+ typeof(p1) +"<br>");
    p1 = 11.1;
    document.write("<br>p1 contains ::"+ p1 +" of Type :: "+ typeof(p1)+"<br>");
    p1 = 'i';
    document.write("<br>p1 contains ::"+ p1 +" of Type :: "+typeof(p1)+"<br>");
    p1 = true;
    document.write("<br>p1 contains ::"+ p1 +" of Type :: "+typeof(p1)+"<br>");
    p1 = "iamlearninghere";
    document.write("<br>p1 contains ::"+ p1 +" of Type :: "+typeof(p1)+"<br>");

</script>

 

Recent Post

Recent Comments

© 2010 IamLearningHere Template by MBT