i am a complete idiot with programming. i have an assignment due tomorrow. it has to take a simple user input, print out the length of the input, the length of the first and last words (causing me the most trouble). then switch some characters around several times and print each new text
'I need something good to die for, to make it beautiful to live' -QSA
Torsten Schippel
Ranch Hand
Joined: May 09, 2003
Posts: 62
posted
0
Hi Nick, shall we do your work? I would recommend a StringBuffer. Regards Torsten
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
If you read the user input into a String then you can use one of the methods of String to find the length. You can use another method of String to find the first space (everything before it would be the first word) and the last space (everything after it would be the last word). You can also achieve similar results by reading the user input into an array of chars and then using a for loop to find the spaces. If you get some code together, post it here and maybe we can help you get through this.
I am moving this to "Java in General (beginners)".
Missus Norah
Greenhorn
Joined: Sep 30, 2003
Posts: 1
posted
0
I'm doing about the same assignment as Nick Allen only I have to produce four files- ServerModel, ClientModel, ServerView and ClientView. Here is my can someone help me?!? thanks so much...