Closed Thread
Results 1 to 3 of 3

Thread: JAVA ARRAY Class Help ! THNX !

  1. #1
    amtrbz is offline Newbie
    Join Date
    Feb 2010
    Posts
    1
    Rep Power
    0

    Smile JAVA ARRAY Class Help ! THNX !

    Create a class named ArrayClass. The class will have:

    · Fields:

    -an int named sizeOfArray

    -An int named theArray

    · No-arg Constructor that assigns 0 to sizeOfArray and to each element of theArray

    · Parameter Constructor that accepts an int and an int array

    · Copy Constructor that accepts an object of the class ArrayApplication

    · Method bubbleSortArray has no argument. the method will sort the theArray and return the time of sorting process by using method System.nanoTime(); that returns a long number.

    · Method selectionSortArray has no argument. The method will sort the theArray and return the time of sorting process (as above)

    · method toString will print out the array elements.

    For example: theArray = { 4, 8, 16, 77, 2, 57, 80 }

    Output should be:

    Array: 4 8 16 77 2 57 80



    Create a controlling class named ArraySortDemo that include the main method.

    The main method will do the following:

    -Display the question asking users how to enter the array elements by display the menu

    1. Input from the keyboard

    2. Input from the file

    Select the number to continue: _



    -Read the input from users

    -If the input is 1, display the message to ask users to type in a series of numbers separating by a space and stop by

    pressing the Enter key.

    -If the input is 2, display the message to ask users to type the name of the file to read , then read the array from the file.



    -Display the question asking users to choose the method to sort the array:

    1. Bubble sort

    2. Selection sort

    Select the number to continue:_



    -Read the number: if 1, call the method bubbleSortArray, then display the result and the time of process

    if 2, call the method selectionSortArray, then display the result and the time of process

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Sep 2007
    Location
    Karlstad, Sweden
    Posts
    3,082
    Blog Entries
    7
    Rep Power
    42

    Re: JAVA ARRAY Class Help ! THNX !

    Well, where's the problem? how far have you came yourself?
    __________________________________________
    I study Information Systems at Karlstad University when I'm not on CodeCall

  4. #3
    so1i's Avatar
    so1i is offline Programming Professional
    Join Date
    Sep 2009
    Location
    Aberystwyth, United Kingdom
    Posts
    309
    Rep Power
    0

    Re: JAVA ARRAY Class Help ! THNX !

    People will help you with code, but it's a bit pointless to just do it all from scratch for you

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problems with array of class
    By Rei_NERV in forum C and C++
    Replies: 6
    Last Post: 06-05-2010, 08:44 PM
  2. Android converting short array to byte array using java on android device.
    By maxsap in forum Mobile Development
    Replies: 0
    Last Post: 04-26-2010, 04:14 AM
  3. Replies: 0
    Last Post: 04-26-2010, 04:14 AM
  4. Overloading Operators for Array Class
    By ahmed in forum C and C++
    Replies: 12
    Last Post: 04-25-2009, 10:11 AM
  5. Cannot marshal class array in function
    By szahn in forum Managed C++
    Replies: 0
    Last Post: 03-21-2008, 04:01 PM

Tags for this Thread

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