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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!