Results 1 to 7 of 7

Thread: Can anyone solve this problem?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Location
    Kirkland, WA
    Posts
    7

    Can anyone solve this problem?

    Add the missing lines of code so that the output of the following code snippet is:
    “Final array values: -978 –10 –9 18 49 99 287 463 5623 100123?”

    Code:
    	
                    Dim NumbersList() as Integer = {99, -10, 100123, 18, -978, 5623, 463, -9, 287, 49}
    	Dim a as Integer
    	Dim b as Integer
    	Dim i as Integer
    
    	For a = 1 to NumbersList.Length
    		For b = NumbersList.Length -1 to a Step -1
    		‘ADD CODE HERE
    		Next
    	Next
    
    	Debug.WriteLine(“Final array is:”)
    	For i = 0 to NumbersList.Length
    		Debug.WriteLine(“ “ + NumbersList(i))
    	Next

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    I think I speak for everyone when I say..... do your own homework.

    You can ask us specific questions, but we arn't going to just "solve x" for you.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Location
    Kirkland, WA
    Posts
    7
    Ive been beating my head on this one for hours, its killin me

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Do you not realize that all you are doing is sorting them from least to greatest?

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Why not try researching the Array.Sort method?

  6. #6
    Lively Member
    Join Date
    Sep 2002
    Posts
    90
    the most obivous answer is the one often missed...

  7. #7
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Originally posted by Edneeis
    Why not try researching the Array.Sort method?
    Maybe they need him to implement a very basic sort method to learn concepts, not to use the sort methods that are already available.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

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



Click Here to Expand Forum to Full Width