Question
Write a program called PalinPerfect.java that finds all palindrome perfect squares between two integers supplied as input (start and end points are excluded). A palindrome
Write a program called PalinPerfect.java that finds all palindrome perfect squares between two integers supplied as input (start and end points are excluded).
A palindrome number is a number that reads the same from the front and the back.
For example: 212, 44, 9009, 4567654
Hint: To calculate whether a number is a palindrome or not, you can first reverse the number (using the % operator and a loop, or a String) and then check for equality.
A perfect square is a number that is the square of an integer. For example: 1, 4, 9, 16, ...
Hint: Use Math.sqrt to find the square root of a number.
Some examples of palindromic perfect squares are: 4, 121, 676.
Sample I/O:
Enter the starting point N:
200
Enter the ending point M:
678
The palindromic perfect squares are as follows:
484
676
The code should be efficient and not get killed for large values of M and N.
Moreover if input M is 4 and N is 4 for example, there should be no output.
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