Link to home
Start Free TrialLog in
Avatar of sami1983
sami1983

asked on

Writing string methods

i have been tryin to write these methods but have been unable to do them at all please see if u can do these and email me thankx a lot
sam

public static String[] grow(String[] small, double factor) – This method returns an array of Strings storing the identical Strings and in the same order as those contained in the array of Strings small, however, the length of the returned array of Strings is (factor * small.length).  Factor must be >= 1.0.

           

public static boolean add(String[] set, String str) – This adds the String str to the array of Strings set if set contains no String equal to str.  Returns true if the String str was added, false otherwise.

           

public static void selectionSort(String[] s) – This method sorts the Strings contained in the array of strings s lexicographically.

           

public static void print(String[] s) – This method prints the Strings contained in the array of Strings s to the display with a space between each String.  A new line follows the last String.

           

public static void copy(String[] from, String[] to) – This method copies the Strings contained in the array of Strings from into the array of Strings to.  If array to is smaller than array from only the first to.length Strings will be copied into the array to.

ASKER CERTIFIED SOLUTION
Avatar of Exceter
Exceter
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tebogo
Tebogo

Sami, are you really serious.Think about your future possitively and do your homework.
Avatar of sami1983

ASKER

listen by the way i alreayd have done the methods...i was gettin a couple errors and therefore i wanted to compare