Results 1 to 3 of 3
  1. #1
    usa100 is offline Member
    Join Date
    Jan 2011
    Posts
    2
    Rep Power
    0

    Exclamation Java idiot...help!!!

    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--)
    {
    if (sen.charAt(c)=='')
    {
    String sb = sen.substring(c+1,ori+1);
    system.out.print(sb)" ";
    ori = c;
    }
    }
    Last edited by usa100; 01-05-2011 at 03:23 PM.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default

    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.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Am I an IDIOT ?????????????
    By Mandilon in forum New To Java
    Replies: 1
    Last Post: 02-02-2008, 09:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •