Question: PLEASE HELP IN JAVA: Write a program to determine whether an input string is a palindrome. You are to use a stack . Input file

PLEASE HELP IN JAVA:

Write a program to determine whether an input string is a palindrome. You are to use a stack .

Input file is p.txt Each phrase is on a line in the input file. (Must use try/catch). Output should be of the form: "A Toyota's a Toyota." is a palindrome.

Create a method called isPalin, which returns true or false depending on whether the argument is a palindrome or not. Your main program will call this method with the input string as the argument, and then output either "is a palindrome" or "is not a palindrome" depending what is returned from the method.

isPalin, MUST use a stack.

p.txt:

I man am regal

a German

am i

Never

odd

or even

lever

Rats

live

on an evil

star

If I had a Hi-Fi

racecard

Too

hot to hoot

Do geese

see

God?

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!