Results 1 to 4 of 4

Thread: solve programming jav

  1. #1
    Usman Khalid's Avatar
    Usman Khalid is offline Junior Member
    Last Online
    19th September 2014 @ 01:46 PM
    Join Date
    18 Dec 2006
    Age
    38
    Posts
    28
    Threads
    13
    Credits
    0
    Thanked
    0

    Default solve programming jav

    develop an interactive page using JavaScript that takes 5 Names in an Array .This page should take 5 Names from the user and then display them in a dialog box. Moreover you have to Sort these names in alphabetical order.

    Your page should have three buttons. The names of buttons and their functionality are described below:

    1. Enter Names: On pressing this button the user should be prompted to give 5 Names one by one.
    2. Sort: On pressing this button, all the names, which have been entered in the prompt box, should be sorted alphabetically.
    3. Show Names: On pressing this button, all the Names that you have entered should be displayed in a dialog box.

  2. #2
    Join Date
    12 May 2006
    Location
    Pakistan
    Age
    38
    Posts
    2,919
    Threads
    65
    Credits
    960
    Thanked
    0

    Lightbulb

    Usman bahi Cs101 ki assign hay .. apna kam kho dkarna cahayah .. borii bat ... wasay May nay bana liyah hay .. last button may thora masla hay .. but .. check it ..

    Code:
    <HTML>
    	<HEAD>
    		<TITLE>khan_z</TITLE>
    		<SCRIPT>
    function entername(){
    			words = new Array ( 5 ) ;
    			for ( a = 0 ; a < words.length ; a = a + 1 ) {
    			words[ a ] = window.prompt( "Enter  Names # " ,"" ) ;
    			}
    }
    function sortword(){			
    
    			words.sort( ) ;
    			window.alert( "Name has been Sorted" ) ;
    }
    function displayname(){
    b=1;
    while(b<=5)
    for ( c = 0 ;c < words.length ; c++ ) 
    {
    window.alert("The Name you Entered Are: \n"+b+")."+ "Array"   +  "{"+c+"} =  "+ words[ c ]);
    	b++;		}
    }
    		</SCRIPT>
    
    	</HEAD>
    	<BODY>
    <center><h4>Array With Events</h4></center>
    <input type ="button" value="Enter Name" name="1" onClick=entername()><br><br>
    <input type ="button" value="Sort Name" name="2" onClick=sortword()><br><br>
    <input type ="button" value="Show Name" name="3" onClick=displayname()>
    
    
    	</BODY>
    </HTML>
    .......

  3. #3
    Usman Khalid's Avatar
    Usman Khalid is offline Junior Member
    Last Online
    19th September 2014 @ 01:46 PM
    Join Date
    18 Dec 2006
    Age
    38
    Posts
    28
    Threads
    13
    Credits
    0
    Thanked
    0

    Default thanks

    dear thanks

  4. #4
    Usman Khalid's Avatar
    Usman Khalid is offline Junior Member
    Last Online
    19th September 2014 @ 01:46 PM
    Join Date
    18 Dec 2006
    Age
    38
    Posts
    28
    Threads
    13
    Credits
    0
    Thanked
    0

    Default

    thaknks

Similar Threads

  1. Programming.
    By ShahidNiazi in forum Ask an Expert
    Replies: 2
    Last Post: 6th August 2012, 04:36 AM
  2. help me about programming
    By ithoun in forum Ask an Expert
    Replies: 2
    Last Post: 16th June 2012, 01:47 AM
  3. Replies: 5
    Last Post: 18th December 2010, 07:34 PM
  4. Web Programming
    By asifsomy in forum Ask an Expert
    Replies: 6
    Last Post: 9th February 2010, 07:30 PM
  5. I need help Programming
    By Rizvann in forum Ask an Expert
    Replies: 3
    Last Post: 7th July 2009, 11:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •