We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

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 No 03 Fall 2019 Solution & Discussion

CS101 Assignment No 03 Fall 2019 Solution & Discussion

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

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

Views: 1159

# CS101 Assignment 3 Solution 2020 Fall

Watch till the end otherwise you have grade zero so its most important for you watch the end and make change on 3 places Dowanload Link But make 3 change before submitting

1. change color..

2.. change background color

CS101 Introduction to Computing Assignment 3 Solution & Discussion Fall 2019

Solution idea:

`<html><head><title>Your VU-ID</title><script type="text/javascript">function generateTable(){var number = document.getElementById('number').value;var length = document.getElementById('length').value;if(parseInt(number) < 1 || parseInt(length) < 1){alert("Invalid Input!");return;}var tableArr = new Array();length = parseInt(length);number = parseInt(number);var oddCount = 0;var evenCount = 0;var checkNumber;for(var i = 1; i <= length; i++){var calc = number + " X " + i + " = " + (number * i) + '\n';tableArr.push(calc);checkNumber = number * i;if(checkNumber % 2 == 0){evenCount++;}else{oddCount++;}}document.getElementById('even').value = evenCount;document.getElementById('odd').value = oddCount;document.getElementById('table-area').value = tableArr.join("");}</script></head><body style="text-align: center; background-color: aqua;" ><h1><u>Table Genrator</u></h1><table border="1" align="center" style="background-color:lightgreen;"><tr><td>Enter Table Number</td><td><input type="number"id="number"></td></tr><tr><td>Enter Table Length</td><td><input type="number"id="length"></td></tr></table><br><button id="gen-btn" onclick="generateTable()">Generate</button><br><br><table border="1" align="center" style="background-color:lightgreen;"><tr><td>Total Even Values</td><td><input type="text" readonlyid="even"></td></tr><tr><td>Total Odd Values</td><td><input type="text" readonlyid="odd"></td></tr><tr ><td colspan="2" align="center"><textarea readonly id="table-area" rows="20" cols="38"placeholder="Table output will be displayed here."></textarea></td></tr></table></body></html>`

CS101 Introduction to Computing Assignment 3 Solution & Discussion Fall 2019

 Assignment No. 03Semester: Fall 2019Introduction to Computing - CS101 Total Marks: 20  Due Date: 16-01-2020 Objectives: After solving this assignment, students will learn about, Interaction of JavaScript with HTML. Handling of JavaScript functions, loops, decision structure & event handling. Instructions: Read the following instructions carefully before submitting the assignment. It should be clear that your assignment will not get any credit if: §  The assignment is submitted through email or after due date. §  The assignment is not in the .html format. §  The submitted assignment does not open or file is corrupt. §  Assignment is copied(partial or full) from any source (websites, forums, students, etc) §  Assignment is in any other format like images, PDF, “.txt”, “.doc”, Zip, rar etc. Question: You are required to make a table generator webpage. Requirements: The title of the web page should be your VU-ID. Table Generator should get the table number and table length from user and generates table of that number up to the provided length with generate button. It should also count even and odd values in the output & displays these counts in their respective fields. If user inputs value less than 1 it should not generate table but display an alert message with “Invalid Input” If user enters a float number then it should ignore decimal part in calculation.   You have to make two tables with border. First table will have two table rows of and second table will have two table rows of and one table row of

Thank u so much for sporting me

# CS101 Assignment Solution guidelines.

Coding cs101
<html>
<script type="text/javascript">
function generateTable(){
var number = document.getElementById('number').value;
var length = document.getElementById('length').value;
if(parseInt(number) < 1 || parseInt(length) < 1){
return;
}
var tableArr = new Array();
length = parseInt(length);
number = parseInt(number);
var oddCount = 0;
var evenCount = 0;
var checkNumber;
for(var i =1; i <= length; i++){
var calc = number + " X " + i + " = " + (number * i) + '\n';
tableArr.push(calc);
checkNumber = number * i;
if(checkNumber % 2 == 0){
evenCount++;
}else{
oddCount++;
}
}
document.getElementById('even').value = evenCount;
document.getElementById('odd').value = oddCount;
document.getElementById('table-area').value = tableArr.join("");
}
</script>
<body style="text-align: center; background-color:brown;" >
<h1><u>Table Generator</u></h1>
<table border="1" align="center" style="background-color: pink;">
<tr><td>Enter Table Number</td><td><input type="number" id="number"></td><tr>
<tr><td>Enter Table Length</td><td><input type="number" id="length"></td><tr>
</table><br>
<button id="gen-btn" onclick="generateTable()">Generate</button>
<br><br>
<table border="1" align="center" style="background-color: pink;">
<tr><td>Total Even Values</td><td><input type="text" readonly id="even"></td></tr>
<tr><td>Total Odd Values</td><td><input type="text" readonly id="odd"></td></tr>
<tr ><td colspan="2" align="center">
<textarea readonly id="table-area" rows="20" cols="38" placeholder="Table output will be displayed here."></textarea>
</td></tr>
</table>
</body>
</html>

## Latest Activity

1 hour ago
1 hour ago
1 hour ago
2 hours ago
2 hours ago
мєняσ иιѕα updated their profile
2 hours ago
4 hours ago
4 hours ago

1

2

3

## HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!