Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Palindrome Submit Assignment Submitting a file upload F ile Types java Due Tuesday by 8pm Points 2 Available after Sep 23, 2019 at 7:30am A

image text in transcribed
Palindrome Submit Assignment Submitting a file upload F ile Types java Due Tuesday by 8pm Points 2 Available after Sep 23, 2019 at 7:30am A palindrome is a string that reads the same forwards as well as backwards. There can be numerical palindromes like "1331" or words that are palindromes like "racecar". With your partner, you need to brainstorm a program that will prompt a user to enter a string and then tell them whether or not the string is a palindrome. The program should keep prompting for new strings until the user enters a blank line. Using Eclipse, create a new project named Palindrome and in that project create a class also named Palindrome. This lab is broken up into two parts. Part 1 - Reading input in a loop Before you start doing any coding, brainstorm between the two of you on how to go about starting this program. You need to get your code to repeatedly prompt for a new String until the user enters an empty line, and then end with a goodbye message. What is the algorithm that you need to use? Write your algorithm into comments in the main method of the Palindrome class (as shown in the class notes). The code you write needs to reproduce the following transcript (user entries are in BOLD): Enter a string: 1331 Enter a string: racecar Enter a string: blue on of Enter a string: Empty line read - Goodbye! octor Part II - Checking for a palindrome Now brainstorm with your partner again - once the user has entered a String you need to think about how to tell if it is a palindrome. One way to do this is to compare the characters that are supposed to match. If all of these characters match, then it is a palindrome. If any pair does not match, then it is not a palindrome. Think about the algorithm that does this kind of pairwise character comparison - how would you implement that with a loop? Work out the algorithm with your partner and put it into your code, then fill in the code around your algorithm to complete the task. A sample transcript of what your

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_2

Step: 3

blur-text-image_3

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

25 Vba Macros For Data Analysis In Microsoft Excel

Authors: Klemens Nguyen

1st Edition

B0CNSXYMTC, 979-8868455629

More Books

Students also viewed these Databases questions

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago