Writing string methods

Posted on 2003-03-04
Medium Priority
Last Modified: 2010-04-17
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

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.

Question by:sami1983

Accepted Solution

Exceter earned 100 total points
ID: 8068488
>> ...please see if u can do these and email me thankx a lot

I think not...

It is a direct violation of the EE membership agreement for experts to complete homework assignments.


Expert Comment

ID: 8085140
Sami, are you really serious.Think about your future possitively and do your homework.

Author Comment

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question