Sponsored Links


Results 1 to 2 of 2

Thread: cs101 assignment no 4 complete solution

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1

    Icon19 cs101 assignment no 4 complete solution

    Sponsored Links





    aslam-o-alikam
    cs101 assignment no 4 complete solution

    HTML Code:
    <HTML>
    <HEAD>
    <script>
    function ValidateStartField()
    {
    var chk = /^\d+$/.test(document.forms["mubeen"]["start"].value);
    if (!chk)
    {
    window.alert("Please Enter Numeric Value in start field");
    document.forms["mubeen"]["start"].value="";
    document.forms["mubeen"]["start"].focus();
    return false;
    }
    var x=document.forms["mubeen"]["start"].value;
    if (x==0 || x=="" || x<2 || x>20)
    {
    window.alert("The value of Start field should be between 2 to 20");
    document.forms["mubeen"]["start"].value="";
    document.forms["mubeen"]["start"].focus();
    return false;
    }
    else
    {
    return true;
    }
    }
    function ValidateEndField()
    {
    var chk = /^\d+$/.test(document.forms["mubeen"]["end"].value);
    if (!chk)
    {
    window.alert("Please Enter Numeric Value in end field");
    document.forms["mubeen"]["end"].value="";
    document.forms["mubeen"]["end"].focus();
    return false;
    }
    var x=document.forms["mubeen"]["end"].value;
    if (x==0 || x=="" || x<1 || x>20)
    {
    window.alert("Please Enter Value Greater then Zero");
    document.forms["mubeen"]["end"].value="";
    document.forms["mubeen"]["end"].focus();
    return false;
    }
    }
    function ValidateSizeField()
    {
    var chk = /^\d+$/.test(document.forms["mubeen"]["size"].value);
    if (!chk)
    {
    window.alert("Please Enter Numeric Value in size field");
    document.forms["mubeen"]["size"].value="";
    document.forms["mubeen"]["size"].focus();
    return false;
    }
    else if (document.forms["mubeen"]["size"].value<0 )
    {
    window.alert("Please Enter Value Greater then Zero");
    document.forms["mubeen"]["size"].value="";
    document.forms["mubeen"]["size"].focus();
    return false;
    }
    else if (document.forms["mubeen"]["size"].value>20 || document.forms["mubeen"]["size"].value <2 )
    {
    window.alert("The value of Size field should be between 2 to 20");
    document.forms["mubeen"]["size"].value="";
    document.forms["mubeen"]["size"].focus();
    return false;
    }
    else
    {
    true;
    }
    }
    
    function DisplyTable()
    {
    var a=document.forms["mubeen"]["start"].value;
    var b=document.forms["mubeen"]["end"].value;
    var z1=document.forms["mubeen"]["size"].value;
    m=parseInt(a);
    u=parseInt(b);
    b=parseInt(z1);
    u=u+1;
    b=b+1
    document.write('<center><table width="80" border="0"> ');
    document.write('<tr>');
    var c=1;
    for (i=a;i<u;i++)
    {
    document.write('<td>');
    document.write('<center><table width="20" border="1"> Table of '+i+'');
    document.write('<tr>');
    for (j=1;j<b;j++)
    {
    document.write('<td>' +i+ '</td>');
    document.write('<td>*</td>');
    document.write('<td>' +j+ '</td>');
    document.write('<td>=</td>');
    document.write('<td><b>' +i*j+ '</b></td>');
    document.write('</tr>');
    }
    document.write('</table></center>');
    document.write('</td>');
    c=c+1;
    if (c>4)
    {
    document.write('</tr>');
    c=1;
    }
    }
    document.write('</tr>');
    document.write('</table></center>');
    }
    function GenerateTables()
    {
    if (!ValidateStartField()||!ValidateEndField()||!ValidateSizeField() )
    {
    }
    if (ValidateStartField()&&ValidateEndField()&&ValidateSizeField() )
    {
    }
    else
    {
    DisplyTable();
    }
    }
    </script>
    </head>
    <body>
    <form name="mubeen" id="mubeen" method="post" action="">
    <p align="center"><b><font size="7">Fall assignment No::: 4_2011 (CS101)</font></b></p>
    <p>&nbsp;</p>
    <table border=2 align=center cellpadding=6 width="280">
    <tr>
    <td><p align="right"><b>Start:</b></td>
    <td><input name="start" type="text" onChange="ValidateStartField()" ></td>
    </tr>
    <tr>
    <td>
    <p align="right"><b>End: </b></td>
    <td><input name="end" type="text" onChange="ValidateEndField()" ></td>
    </tr>
    <tr>
    <td><p align="right"><b>Depth/Size:</b></td>
    <td><input name="size" type="text" onChange="ValidateSizeField()" ></td>
    </tr>
    <tr>
    <td></td>
    <td><input name="Generate Tables" type="button" onClick="GenerateTables()" value="Generate Tables" ></td>
    </tr>
    </table>
    </form>
    </center>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p align="center"><font color="#FF0000" size="5"><b>Composed: by Mubeen Mehmood</b></font></p>
    <p align="center"><b><a href="mailto:Mubeenmehmood@gmail.com">
    <font color="#FF0000" size="5">Mubeenmehmood@gmail.com</font></a></b></p>
    <p align="center"><font color="#FF0000" size="5"><b>Id: MC110401647</b></font></p>
    </body>
    </html>

  2. #2
    Administrator Vuhelper's Avatar Users Flag!
    Join Date
    Apr 2011
    Posts
    8,491
    keep it up

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. solution of cs101 assignment # 2 :-)
    By Nazeer Ahmad khan in forum Get Solution In 24 Hour
    Replies: 1
    Last Post: 11-14-2011, 10:23 PM
  2. Replies: 2
    Last Post: 11-03-2011, 11:24 AM
  3. Assignment No. 1 CS101 Need Solution ????
    By a.1i_x in forum Assignments & Solutions
    Replies: 7
    Last Post: 10-28-2011, 10:36 PM
  4. CS-201 5th assignment complete solution
    By gm mughal in forum Mcs
    Replies: 2
    Last Post: 06-30-2011, 04:44 PM
  5. ENG201 Assignment#1 Fall 2010 Solution Complete.
    By desireforheaven in forum Assignments & Solutions
    Replies: 0
    Last Post: 10-21-2010, 06:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft