PDA

View Full Version : help on java


sunklay69
08-28-2005, 04:44 AM
I was doing a homework, well i was trying to do this,but I realize that I would not under stand this i somebody don't explain me this shh....

I need to do an public interface of the class WordProcessor

* WordProcessor()
o creates an object in the class.
* void append(String text)
o Insert the text on "text" that will be on the bottom of the program.
* void replace(String search, String newText)
o replace the document on "search" with the text on "newText"
* void insert(String text, int position)
o insert the text on the position indicated
* void remove(String text)
o remove from the document things.
* void display()
o display the text

the tester will be like this
1. create an intance of WordProcessor
2. append the text.
3. display the text
4. replace three words form the text, and display the change
5. insert three lines of text, in separate form, display the change
6. eliminate three words from the document, display the change


I want to learn but I don't know how to start, please help with some thing.

gsoft
08-28-2005, 06:36 AM
Make an attempt at this then come back with what your having problems with. You should also read the stickied FAQ about Homework.

sunklay69
08-28-2005, 05:20 PM
Sorry by not posting my methods, I forget. This is what I have the first part is the one thhat I'm stock on I don't know how to make the WordProcessorTester.java


public class WordProcessor {



public WordProcessor(){
String text = new String();
}
//this will append the document that is in the bottom of the methods.
public void append(String text){
text = this.text;
return;
}
//I having trouble in this part
//this will replace one word of the entire document by the one that is in //"newText"
public void replace(String search, String newText){

return;
}
//this also having problem
//will insert three lines of text in separate form.
public void insert(String text, int position){

return;
}
//this will remove three words of the document.
public void remove(String text){

return;
}
//this will dysplay the document when ever there is a change.
public void display(){
System.out.println();
return;
}

String text = "Document that will be display";



}

//I don't know what to do in here.
public class WordProcessorTester {

/**
* @param args
*/
public static void main(String[] args) {


}

}