Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

I'm new @ java....help

DavefromCanadaDavefromCanada Member Posts: 36
Hi, my name is Dave. And it's my first time using Java programming.

I need help from you guys on something (nothing too difficult I hope).

I decided to create a program that ask a user for a word, then print out the word in reverse form. Example: Money >>>>yenom.

Follow with a display of every 2nd letter starting with the first letter. Example: Elephant >>>>> eehn.

I'm doing this in console application.

Comments

  • geckoistgeckoist Member Posts: 6
    : Hi, my name is Dave. And it's my first time using Java programming.
    :
    : I need help from you guys on something (nothing too difficult I hope).
    :
    : I decided to create a program that ask a user for a word, then print out the word in reverse form. Example: Money >>>>yenom.
    :
    : Follow with a display of every 2nd letter starting with the first letter. Example: Elephant >>>>> eehn.
    :
    : I'm doing this in console application.
    :
    Well, I probably could do something for you if I had the time... Do you want some actual code? (Doesn't sound like too hard of a problem.) Really, if you had a good reference manual for java, you probably could work this through by yourself. (Have you worked with OOP languages before?) Anyway, I'll see what I can do. Have a nice day!

    The Geckoist

    Oh, console means something like a DOS window, right?
  • DavefromCanadaDavefromCanada Member Posts: 36
    Actually, my manual didn't come in a form of a book, and it's not well directed either.
  • javanovicejavanovice Member Posts: 2
    : Hi, my name is Dave. And it's my first time using Java programming.
    :
    : I need help from you guys on something (nothing too difficult I hope).
    :
    : I decided to create a program that ask a user for a word, then print out the word in reverse form. Example: Money >>>>yenom.
    :
    : Follow with a display of every 2nd letter starting with the first letter. Example: Elephant >>>>> eehn.
    :
    : I'm doing this in console application.
    :
    Hey Buddy, I have a good book that can help you doing this, if not the whole then at certain extent!!
    ok i can think of your 1st question since i have done very similar program recently!!
    I am not much familiar with console application. Now if that is GUI window, the application is just a piece of cake.
    anyway, the method that will reverse your words order is like the following:

    public String reverse( String s ) {
    StringBuffer outPut = new StringBuffer();
    //the following loop runs from the end index of your word
    // to the beginning index in reverse
    for(int i = word.length()-1; i >=0; i--) {

    outPut.append(word.charAt(i)); // this statement simply adds
    // all characters in reverse
    // Order
    }
    return outPut.toString(); // returns reverse ordered word
    }
    I think at 12:55 am I can be of some help. enjoy!!
    the 2nd question is not hard but it requires me to think further.
    remember the above engine is just to reverse the word, not anything else!!

    ++javanovice.
  • geckoistgeckoist Member Posts: 6
    : : Hi, my name is Dave. And it's my first time using Java programming.
    : :
    : : I need help from you guys on something (nothing too difficult I hope).
    : :
    : : I decided to create a program that ask a user for a word, then print out the word in reverse form. Example: Money >>>>yenom.
    : :
    : : Follow with a display of every 2nd letter starting with the first letter. Example: Elephant >>>>> eehn.
    : :
    : : I'm doing this in console application.
    : :
    : Hey Buddy, I have a good book that can help you doing this, if not the whole then at certain extent!!
    : ok i can think of your 1st question since i have done very similar program recently!!
    : I am not much familiar with console application. Now if that is GUI window, the application is just a piece of cake.
    : anyway, the method that will reverse your words order is like the following:
    :
    : public String reverse( String s ) {
    : StringBuffer outPut = new StringBuffer();
    : //the following loop runs from the end index of your word
    : // to the beginning index in reverse
    : for(int i = word.length()-1; i >=0; i--) {
    :
    : outPut.append(word.charAt(i)); // this statement simply adds
    : // all characters in reverse
    : // Order
    : }
    : return outPut.toString(); // returns reverse ordered word
    : }
    : I think at 12:55 am I can be of some help. enjoy!!
    : the 2nd question is not hard but it requires me to think further.
    : remember the above engine is just to reverse the word, not anything else!!
    :
    : ++javanovice.
    :


    Hey, you've got my interest. What is the name of this book?
Sign In or Register to comment.