Thursday, January 19, 2012

Re: (VU-Study-Corner) CS101 Assignment # 4 Solution



On Wed, Jan 18, 2012 at 8:28 PM, ibrar ulhaq <ibrarulhaq@gmail.com> wrote:

 

Q1

 

<html>

 <head>

   <title></title>

<script>

  function checkform()

    {

      if(document.computer.a1.value<1)

        {

          window.alert("Start Text box is empty");

        }

    }

</script>

 </head>

<body>

<form name="computer" method="post" action="abcd">

 <table border="2">

 

  <tr>

    <td>Start:</td>

    <td><input type="text" size="25" name="a1"></input></td>

  </tr>

 

  <tr>

    <td>End:</td>

    <td><input type="text" size="25" name="a2"></input></td>

  </tr>

 

  <tr>

    <td>Depth/Size:</td>

    <td><input type="text" size="25" name="a3"></input></td>

  </tr>

 

  <tr>

    <td></td>

    <td><input type="submit" value="Generate Tables" name="a4" onMouseOver="checkform()"></input></td>

  </tr>

 

 </table>

</form>

</body>

</html>

 

 

 

Q2

<html>

 <head>

   <title></title>

<script>

  function checkform()

    {

      if(document.computer.a1.value<1)

        {

          window.alert("Start Text box is empty");

        }

 

      if(document.computer.a2.value<1)

        {

          window.alert("End Text box is empty");

        }

 

      if(document.computer.a3.value<1)

        {

          window.alert("Depth/Size Text box is empty");

        }

    }

</script>

 </head>

<body>

<form name="computer" method="post" action="abcd">

 <table border="2">

 

  <tr>

    <td>Start:</td>

    <td><input type="text" size="25" name="a1"></input></td>

  </tr>

 

  <tr>

    <td>End:</td>

    <td><input type="text" size="25" name="a2"></input></td>

  </tr>

 

  <tr>

    <td>Depth/Size:</td>

    <td><input type="text" size="25" name="a3"></input></td>

  </tr>

 

  <tr>

    <td></td>

    <td><input type="submit" value="Generate Tables" name="a4" onMouseOver="checkform()"></input></td>

  </tr>

 

 </table>

</form>

</body>

</html>

 

 

Q3

<html>

 <head>

   <title></title>

<script>

  function checkform()

    {

      if(document.computer.a1.value<1)

        {

          window.alert("Start Text box is empty");

        }

 

      if(document.computer.a2.value<1)

        {

          window.alert("End Text box is empty");

        }

 

      if(document.computer.a3.value<1)

        {

          window.alert("Depth/Size Text box is empty");

        }

      var table,x;

      table=5;

      for(x=1; x<=10; x++)

       {

         document.write(table+"*"+x+"="+table*x+"<br>");

       }

    }

</script>

 </head>

<body>

<form name="computer" method="post" action="abcd">

 <table border="2">

 

  <tr>

    <td>Start:</td>

    <td><input type="text" size="25" name="a1"></input></td>

  </tr>

 

  <tr>

    <td>End:</td>

    <td><input type="text" size="25" name="a2"></input></td>

  </tr>

 

  <tr>

    <td>Depth/Size:</td>

    <td><input type="text" size="25" name="a3"></input></td>

  </tr>

 

  <tr>

    <td></td>

    <td><input type="submit" value="Generate Tables" name="a4" onMouseOver="checkform()"></input></td>

  </tr>

 

 </table>

</form>

</body>

</html>

 

 

Q4

 

<html>

 <head>

   <title></title>

<script>

  function checkform()

    {

      if(document.computer.a1.value<1)

        {

          window.alert("Start Text box is empty");

        }

 

      if(document.computer.a2.value<1)

        {

          window.alert("End Text box is empty");

        }

 

      if(document.computer.a3.value<1)

        {

          window.alert("Depth/Size Text box is empty");

        }

      var start,end,table;

      table=4;

      var a,b;

      a=document.computer.a1.value;

      b=document.computer.a2.value;

      start=parseInt(a);

      end=parseInt(b);

      for(x=start; x<=end; x++)

       {

         document.write(table+"*"+x+"="+table*x+"<br>");

       }

    }

</script>

 </head>

<body>

<form name="computer" method="post" action="abcd">

 <table border="2">

 

  <tr>

    <td>Start:</td>

    <td><input type="text" size="25" name="a1"></input></td>

  </tr>

 

  <tr>

    <td>End:</td>

    <td><input type="text" size="25" name="a2"></input></td>

  </tr>

 

  <tr>

    <td>Depth/Size:</td>

    <td><input type="text" size="25" name="a3"></input></td>

  </tr>

 

  <tr>

    <td></td>

    <td><input type="submit" value="Generate Tables" name="a4" onMouseOver="checkform()"></input></td>

  </tr>

 

 </table>

</form>

</body>

</html>

 

 

 

 

--
Join us at facebook: https://www.facebook.com/VU.Study.Corner
 
Group Link: http://groups.google.com/group/VU-Study-Corner?hl=en
 
Group Rules: http://groups.google.com/group/VU-Study-Corner/web/group-rules
 
Unsubscribe: VU-Study-Corner+unsubscribe@googlegroups.com
 
Adult contents, Spamming, Immoral & Rudish talk, Cell number, Websites & Groups links specially in paper days are strictly prohibited and banned in group.

--
Join us at facebook: https://www.facebook.com/VU.Study.Corner
 
Group Link: http://groups.google.com/group/VU-Study-Corner?hl=en
 
Group Rules: http://groups.google.com/group/VU-Study-Corner/web/group-rules
 
Unsubscribe: VU-Study-Corner+unsubscribe@googlegroups.com
 
Adult contents, Spamming, Immoral & Rudish talk, Cell number, Websites & Groups links specially in paper days are strictly prohibited and banned in group.

No comments:

Post a Comment