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


+ Link For Assignments, GDBs & Online Quizzes Solution


+ 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 - Introduction to Computing Assignment No. 03 Solution and Discussion Spring 2014 Due Date 11-July-14


The objective of this assignment is to introduce students with the concepts of Arrays, conditions, loops in JavaScript and making interactive web pages with their combination.

Lectures Covered:    21 - 26                                                  


  • Your assignment must be submitted in “.html” format. Assignment submitted in any other format will not be accepted and will be awarded with zero marks.

Assignment:                                                                                                                         Marks 20

 You are required to develop a web page which will create an array of strings and then it will sort the array in ascending and descending orders. The number of elements of the array will be specific by the user at run time.

 Detailed Description:

1. You are required to develop a web page as shown below:

2. User will specify the number of array elements in the text field and then click on “Take Input” button. This process will create an array of specified number in the text field and also take input from user in those elements. Example is shown in the figure below:


Here 5 is number of elements of the array. On clicking on “Take Input” button, the Prompt window should display asking for input in the array elements one by one.


3. After taking inputs, if the user clicks on “Ascending” button, then the entered values should be sorted and displayed in ascending order and if user clicks on “Descending” button, then it should be sorted in descending order. Example is shown in the figures below assuming that the inputs are “Table”, “Chair”, “Door”, “Fan”, and “House”.


  1. You can make this assignment by making some modifications in the example program given in Lecture 26
  2. Event handlers and functions are the core concepts for solving this assignment


You have to modify the font size of the output array otherwise marks will be deducted.


+ 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: 10326


+ 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

sir is main jo list ai hui ha assignment mai wo kio ni show hoti?

table chair etc.is k mutallak plz btain na kch.ye point smajh ni aa raha..

Bro, Assignment mein sirf aek example di gayi hai k agar user ye 5 words enter page mein enter karien to wo sort ya unsort kar diye jaein. Aon words ka page ki coding se koi relation nahi,

CS101 assignment 3 SOLUTION spring 2014 


function a() {
var val = parseInt(document.getElementById('valueField').value)
var words = new Array(val);
Please explain me this ... smjh hi nahi arha kia likha hai

must take web development lecture after this one

wohi words nazer ni aaye gy jo assignment men hy

blka wo words nazer aye gy jo ap khd prompt window men likho gy

Just Follow Step By Step Procedure..

01: Start > Open NotePad

02: Put Ur Code.


<title>Javascript Arrays</title>


<body bgcolor="#F0F0F0">

<h1>Implementation of Sort and Reverse Functions </h1>
<h2>Enter number of Elements</h2>

<form name="Anonymous Ghost">
<INPUT type="number" name="takeinput" id="valueField" size="30" />
<Input type="button" name="name1" value="Take Input" onClick="a()"/>

<form name="Anonymous Ghost">
<Input type="button" name="name2" value="Ascending" onClick="b()" />
<Input type="button" name="name3" value="Descending" onClick="c()" />

var words;
function a() {
var val = parseInt(document.getElementById('valueField').value);
words = new Array(val);
for (k = 0; k < words.length; k = k + 1) {
words[k] = window.prompt("Enter String # " + k, "");
function b() {
words.sort( ) ;
document.write( "SORTED WORDS:" + "<BR>" ) ;
for ( k = 0 ; k < words.length ; k = k + 1 ) {
document.write( words[ k ] + "<BR>" ) ;
function c() {
words.sort( ) ;
words.reverse( ) ;
document.write( "SORTED WORDS:" + "<BR>" ) ;
for ( k = 0 ; k < words.length ; k = k + 1 ) {
document.write( words[ k ] + "<BR>" ) ;

03: Save where u want to do. (Downloads or Desktop or any where)

 Ctrl+S > give ur VU ID> . HTML n Click Save.

04: Open ur Chrome file.

05: See ur work in browser.. Give the input '5' n click Take Input.

06:  Give the Name of things..n click ok

07: Now click Ascending button. u 'll see like this..

08: Now click Descending button. u 'll see like this..

U can check ur HTML Code with ONLINE HTML EDITOR.

Just put ur code here and check..



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

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