Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Omega_Sentinel

  • 2 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
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    Which language?

  2. Omega_Sentinel
    • 2 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
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    yes please

  4. Omega_Sentinel
    • 2 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
    • 2 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
    • 2 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
    • 2 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

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.