Create using Java Description: Palindrome -- According to wikipedia \"A palindrome is a word, phrase, number or other...

80.2K

Verified Solution

Question

Programming

Create using Java

Description: Palindrome -- According towikipedia \"A palindrome is a word, phrase, numberor other sequence of units that can be read the same way in eitherdirection\"
Write a application that can determine if a 5 digit number youinput is a palindrome. If the number is a palindrome then print\"The number is a palindrome.\" If it is not then print \"The numberis NOT a palindrome\"
Make sure to use an array

  1. Allow input of any length integer (ie 12345654321 would bevalid input)
  2. Allow input of any number of any alphanumeric characters (ieabg345tghtriu8 would be valid input)

//-----------------------------------
// This is the good version pseudocode
//   create string sInput
//
//   prompt for input
//
//   create char array (cArray) and assignsInput.toCharArray()
//
//   loop to check for palindrome (set i = 0, j =sInput.length()-1, check to see if i != j; increment i, decrementj)
//       check to see if current arrayvalues are !=
//           print not apalindrome
//           return
//       end of loop
//   print is a palindrome
//------------------------------

Answer & Explanation Solved by verified expert
4.0 Ratings (752 Votes)
input codeoutputcodeimport javautilpublic class Main public    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students