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

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

CS101 Assignment No 03 Fall 2019 Solution & Discussion

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

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

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


See Your Saved Posts Timeline

Views: 949

.

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

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

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

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

3. change your own ID

link 

https://drive.google.com/file/d/1T1qTGE8ecJ17sFQBZDe98JoY8wAuf5-M/view

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" 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>

CS101 Introduction to Computing Assignment 3 Solution & Discussion Fall 2019


 

Assignment No. 03
Semester: Fall 2019
Introduction 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 <input> and second table will have two table rows of <input> and one table row of <textarea>. 
  • Your output should be displayed inside <textarea> of 38 columns, 20 rows and colspan 2.
  • Heading, tables and button should be aligned to center.
  • You are required to make same design and format of output as given in below sample.
  • However you can choose color scheme of your own choice (other than white) but the background color of your webpage and table should be different.

Note:

  • You can also use \n in JavaScript instead of <br> for line break in output.
  • If you have any queries, you can email at cs101@vu.edu.pk.

 

Sample design:

Sample output:

Sample alert message:

 

Best of Luck

Thank u so much for sporting me

CS101 Assignment Solution guidelines.

Coding cs101
<html>
<head><title>mc676766788</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: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>

RSS

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.