Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA A palindrome is a word or group of words that reads the same forward as backward. Examples of palindromes are: radar, noon, and Madam,

JAVA

image text in transcribed

A palindrome is a word or group of words that reads the same forward as backward. Examples of palindromes are: radar, noon, and "Madam, I'm Adam". Notice there are different scenarios in the examples: In the palindrome 'radar' the letters on either side of the 'd' are the same. In the palindrome 'noon' the first half of the word ('no') is the mirror image of the second half ('on') of the word. In the palindrome "Madam, I'm Adam" the punctuation is ignored. Create a program which utilizes Queues to determine if a string is a palindrome. In trying to determine if a string is a palindrome, ignore punctuation. When determining if a string is indeed a palindrome, you will want to compare a reversed version of the string to itself. Recall that we used Stacks to create a reversed version of a string. Do the following: Read each string from an external file, converts each character within the string to lower case, and place each character on a Queue and on a Stack. Using both the Queue and the Stack, have the program verify whether or not the string is a palindrome. Be sure to ignore all white space and punctuation (commas, apostrophes, periods, etc.). Use Object Oriented programming and ADT structures. Use the following strings in your external file: A daffodil slid off Ada A Toyota's a Toyota Never odd or even This one is not a palindrome Did Hannah say as Hannah did A man, a plan, a canal -- Panama Was it a car or a cat I saw

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions