Question
Hint: User will enter certain number of random words, you need to read the input as string and evaluate based on the following instructions. Write
Hint: User will enter certain number of random words, you need to read the input as string and evaluate based on the following instructions.
Write a void method called palindromeCheck that takes NO argument. The method should have functionality to check whether or not the word is a palindrome and print to the screen all of the palindromes, one per line. Also, the last line of the output should have the message: There are x palindromes out of y words provided by user (where x is the number of palindrome words detected, and y is the total number of words entered by user). Hint: for this lab exercise you will need the following methods on String objects: length() gives the length of a string (that is, the number of characters it contains) and charAt(i) - gives the character at position i. For example:
int sizeOfString = "bob".length() //should be 3
char firstChar = "bob".charAt(0) //should be b
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