Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cs101 assignment no 4 complete solution
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
aslam-o-alikam
cs101 assignment no 4 complete solution

[HTML]<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>[/HTML]
Reply
#2
keep it up Smile

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ACC501 Business Finance Assignment No.1 Fall Semester 28th November 2012 Vuhelper 1 1,982 03-28-2020, 02:07 AM
Last Post: ArleneKline
  CS615-Software Project Management Assignment no 4 -5th Feb 2016 Vuhelper 0 1,690 02-05-2016, 10:11 PM
Last Post: Vuhelper
  Eng301 Business Communication Assignment No 3 due date 11 FEB,2016 Vuhelper 0 1,586 02-05-2016, 09:49 PM
Last Post: Vuhelper
  MGT111 Assignment No.2 Assignment Solution Due date 3rd Feb 2016 Vuhelper 0 1,845 02-03-2016, 05:37 PM
Last Post: Vuhelper
  FIN630 - Investment Analysis & Portfolio Management Solution 3rd Feb 2016 Vuhelper 0 2,258 02-03-2016, 05:34 PM
Last Post: Vuhelper
  MGT101 Financial Accounting Assignment no 2 solution 20th January 2016 Vuhelper 1 3,471 01-23-2016, 05:14 PM
Last Post: Vuhelper
  MCM101 Introduction to Mass Communication Assignment #3 January 2016 Vuhelper 1 1,963 01-23-2016, 05:13 PM
Last Post: Vuhelper
  mcm311 Reporting and subediting Assignment no 3 January 2016 Vuhelper 0 7,450 01-23-2016, 05:09 PM
Last Post: Vuhelper
  MGT602 assignment no 2 Solution due date 25th January 2016 Vuhelper 0 1,664 01-23-2016, 03:53 PM
Last Post: Vuhelper
  MGT602 Assignment no 2 Solution 20th January 2016 Vuhelper 0 7,553 01-20-2016, 06:53 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support