Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Omega_Sentinel

  • 4 years ago

So how would I be able to check if a String spelled with the first letter moved to the last (like banana -> ananab) is the same as the original word just spelled backwards?

  • This Question is Closed
  1. rivermaker
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Which language?

  2. Omega_Sentinel
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Java. I can put in the code I have so far if it'd help.

  3. rivermaker
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    yes please

  4. Omega_Sentinel
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    do { for (length = word.length() - 1; length >= 0; length--) { oppWord = oppWord + word.charAt(length); } if () oppWord = ""; System.out.println("Please enter the next word: "); word = keyboard.next(); } while (!word.equals("quit")); System.out.println("All done.");

  5. rivermaker
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Write a function to reverse the word, and another to make a string by moving first letter to last; let me call them Reverse() and MoveFirst(); now it must be simpler to write the body of the do while loop. Can you take it from here?

  6. shoot.me
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    in c copy each character to stack and compare each character of string with the elemented popped from stack for starting and ending character write corresponding logic (easy)

  7. rsmith6559
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Ignore the first letter, and check if the rest of the word is a palindrome.

  8. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy