Results 1 to 3 of 3
Thread: Java idiot...help!!!
- 01-05-2011, 03:10 PM #1Member
- Join Date
- Jan 2011
- Rep Power
I got to finish this project by tomorrow, but I really don't know how to. If I don't finish it by Friday, I will be doomed:( I don't understand java AT ALL, I AM A JAVA IDIOT. Please help me finish the project! your help will be appreciated!
The project is Reversewords.
We have to design a function that will take a string of words and hand it back to the caller with all the words reversed (E.g. "i like you" becomes "you like i"). Use two nested for loops in the routine to get your result. Afterwards, in the main, continue asking the user for a sentence- or just type return to end (can use while loop in main).
this is what I got so far.
public class Reversewords
public static void main(String  args)
Scanner inputreader=new Scanner(System.in);
int 0 = sen.getLength()-1;
int c = 0;
for (c=orj; c>0; c--)
String sb = sen.substring(c+1,ori+1);
ori = c;
Last edited by usa100; 01-05-2011 at 03:23 PM.
- 01-05-2011, 03:20 PM #2
When posting code, make sure you use the CODE tags to preserve formatting.
The directions tell you pretty much exactly what to do. Where exactly are you stuck on them? What about them don't you understand?
First off, clean up the syntax errors. The compiler should tell you exactly what's wrong with that. Hint- you can't have statements such as for loops and if statements outside of a method.
After that, read the directions over and over again. Hint- The directions call for nested for loops.
- By Mandilon in forum New To JavaReplies: 1Last Post: 02-02-2008, 09:56 AM