JAVA PROGRAM ASAP ************* THE PROGRAM MUST WORK IN HYPERGRADE AND PASS ALL THE TEST CASES.**************** Chapter 16. PC #5. Palindrome Detector (page 1073) A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Able was I, ere I saw Elba A man, a plan, a canal, Panama Desserts, I stressed Kayak Write a boolean method that uses recursion to determine whether a String argument is a palindrome. The method should return true if the argument reads the same forward and backward. Demonstrate the method in a program. The program should ask the user to enter a string, which is checked for palindrome property. The program displays whether the given input is a palindrome or not, then prompts the user to enter another string. If the user enters QUIT (case insensitive, then exit the program). Test Case 1 Please enter a string to test for palindrome or type QUIT to exit:\n Desserts, I stressedENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n KayakENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER Test Case 2 Please enter a string to test for palindrome or type QUIT to exit:\n dadENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER Test Case 3 Please enter a string to test for palindrome or type QUIT to exit:\n momENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n QuitENTER Test Case 4 Please enter a string to test for palindrome or type QUIT to exit:\n helloENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quiTENTER Test Case 5 Please enter a string to test for palindrome or type QUIT to exit:\n b,a,dENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER Test Case 6 Please enter a string to test for palindrome or type QUIT to exit:\n Able was I, ere I saw ElbaENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER Test Case 7 Please enter a string to test for palindrome or type QUIT to exit:\n A man, a plan, a canal, PanamaENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER Test Case 8 Please enter a string to test for palindrome or type QUIT to exit:\n @abENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n ab@ENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n @aaENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n aa@ENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER Test Case 9 Please enter a string to test for palindrome or type QUIT to exit:\n abbaENTER The input is a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n abcaENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n aabcaaENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n abaceedabaENTER The input is not a palindrome.\n Please enter a string to test for palindrome or type QUIT to exit:\n quitENTER
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
JAVA PROGRAM ASAP
************* THE PROGRAM MUST WORK IN HYPERGRADE AND PASS ALL THE TEST CASES.****************
Test Case 1
Desserts, I stressedENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
KayakENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Test Case 2
dadENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Test Case 3
momENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
QuitENTER
Test Case 4
helloENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quiTENTER
Test Case 5
b,a,dENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Test Case 6
Able was I, ere I saw ElbaENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Test Case 7
A man, a plan, a canal, PanamaENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Test Case 8
@abENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
ab@ENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
@aaENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
aa@ENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Test Case 9
abbaENTER
The input is a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
abcaENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
aabcaaENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
abaceedabaENTER
The input is not a palindrome.\n
Please enter a string to test for palindrome or type QUIT to exit:\n
quitENTER
Step by step
Solved in 4 steps with 2 images