We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

# CS101 assignment 2 solution on july 2016

<html>

<script language"javascript">
var num1;
var num2;
var sum;
function processVal1(){
num1 = document.calc.num.value;
num1 = parseInt(num1);
if(isNaN(num1)){
document.calc.num.value = null;
}
else{
document.getElementById("plus").disabled = true;
document.getElementById("equ").disabled = false;
document.getElementById("labl").innerHTML=""+num1+"+";
document.calc.num.value = null;
document.getElementById("num").focus();
}
}
num2 = document.calc.num.value;
num2 = parseInt(num2);
if(isNaN(num2)){
}
else{
sum = num1 + num2;
document.calc.num.value = sum;
document.getElementById("equ").disabled = true;
document.getElementById("plus").disabled = false;
}
}
function clearVal(){
document.getElementById("equ").disabled = false;
document.getElementById("plus").disabled = false;
document.getElementById("labl").innerHTML="&nbsp;";
document.calc.num.value = 0;
}

</script>
<body>
<form method="post" action="assignment.html" name="calc">
<table border="1" align="left" width="160px">
<tr>
<p id="labl">&nbsp;</p>
</tr>
<tr><td><input type="text" name="num" value="0" id="num"/></td>
</tr>
<tr>
<td>
<input type="button" name="add" value="+" onClick="processVal1();" id="plus" id="plus"/>
<input type="button" name="clr" value="C" onClick="clearVal();"/>
</td>
</tr>
<tr>
<td>
<input type="button" name="equ" value="=" onClick="addVal();" id="equ"/></td>
</tr>
</table>
</form>
</body>
</html>

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 1636

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

Thank you :) :)

## Latest Activity

3 seconds ago
5 minutes ago
11 minutes ago
1 hour ago
2 hours ago
2 hours ago
3 hours ago
3 hours ago
3 hours ago
3 hours ago
3 hours ago
3 hours ago

3 hours ago
3 hours ago
3 hours ago
KyaMusibatHai posted a discussion

### Calling all CSS aspirants! Anyone brave enough to wade through CSS's hottest waters?

3 hours ago
3 hours ago
+ M.Tariq Malik posted a discussion

3 hours ago
3 hours ago
3 hours ago

1

2

3