Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Description: Palindrome -- According to wikipedia A palindrome is a word, phrase, number or other sequence of units that can be read the same way
Description: Palindrome -- According to wikipedia "A palindrome is a word, phrase, number or other sequence of units that can be read the same way in either direction" Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "The number is a palindrome." If it is not then print "The number is NOT a palindrome" Make sure to use an array in this homework If you want to do extra and get an A+: 1. Allow input of any length integer (ie 12345654321 would be valid input) 2. Allow input of any number of any alphanumeric characters (ie abg345tghtriu8 would be valid input) //- // This is the good version pseudocode Il create string sInput // Il prompt for input // // create char array (cArray) and assign sInput.toCharArray() // // loop to check for palindrome (set i = 0, j = sInput.length()-1, check to see if i !=j; increment i, decrement j) // check to see if current array values are != // print not a palindrome // return // end of loop // print is a palindrome //
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started