Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    What is controlling how many times it prints? Look at the for loop statement. Change that so it loops the correct number of times.
  2. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Did you try it? What happened?
  3. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Why does the code change the value of i two times inside of the loop?


    i = word.indexOf(word);
    i = word.indexOf(firstLetter);

    If your are not sure, then remove them.
  4. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Why does the code change the value of i two times inside of the loop?
    It is dangerous to change the loop control variable inside the loop.
  5. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Please post the output from the program and add some comments describing what you want to change.

    Please Edit your post and wrap your code with
    <YOUR CODE HERE> to get highlighting. You did not...
  6. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Have you tried it yet to see what happens? See posts #6 & #8 where I gave the steps the code should do.
  7. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Use the + operator:
    "sdd" + "e" -> "sdde"
  8. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    It looks like you are getting the second part of the String OK. what is happening to the first letter that is supposed to be concatenated to the end of the String? It looks like you remove it and...
  9. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    What prints out when you execute the program? Is the output what you want?
  10. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Solve the problem one small step at a time.
    Take a String and move its first character to the end of the String. Can you do that?

    When that is done, what next?
  11. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    If you understand the methods and how to use them and what they do, what are you waiting for to use some of them to solve the problem?
    A hint:
    1)extract two Strings from the one String. One with a...
  12. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Start by removing one character from the start of the String.
    Concatenate that character at the end of the String.
    Print it.
    Do it again until done.
  13. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    If the project is only changing the position of characters in a String, look at the String class's methods.
    And the StringBuilder and StringBuffer classes.
  14. Replies
    34
    Views
    7,251

    Re: How to Create a Word Rectangle

    Can you define a "word rectangle" and show an example?
Results 1 to 14 of 14