
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write a Java
Make sure the program is done recursively.
Definition of a palindrome
Links to an external site.
Input Data:
Repeatedly, enter one string at a time at the keyboard
alternatively, you may set up an input data file and get the data from the file
Stop the inputting, when the user does not want to enter any additional strings
Processing:
Set up a method to recursively determine if a given string is a palindrome.
Output Data:
The attached screenshot displays sample output, when a program is run based on the above problem statement:

Transcribed Image Text:Enter a string:
mom
The string is mom
The original is a PALINDROME
Again?
yes
Enter a string:
dad
The string is dad
The original is a PALINDROME
Again?
yes
Enter a string:
mommy
The string is mommy
The original string is NOT a Palindrome
Again?
yes
Enter a string:
kayak
The string is kayak
The original is a PALINDROME
Again?
yes
Enter a string:
revive
The string is revive
The original string is NOT a Palindrome
Again?
yes
Enter a string:
revived
The string is revived
The original string is NOT a Palindrome
Again?
yes
Enter a string:
reviver
The string is reviver
The original is a PALINDROME
Again?
yes
Enter a string:
radar
The string is radar
The original is a PALINDROME
Again?
no
Press any key to continue .
•
I
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- python multiple choice Code Example 4-1 def get_username(first, last): s = first + "." + last return s.lower() def main(): first_name = input("Enter your first name: ") last_name = input("Enter your last name: ") username = get_username(first_name, last_name) print("Your username is: " + username) main() 5. Refer to Code Example 4-1: What is the scope of the variable named s ?a. globalb. localc. global in main() but local in get_username()d. local in main() but global in get_username()arrow_forwardjavascripts write a loop prints all three digits number in decreasing order (999 , 998 ,997,..,101,100)arrow_forwardIn PYTHON use a Monte Carlo Simulation to write a code that gives the probability that in a classroom of x people, at least 2 will be born on the same day of the year, ignoring leap year? The number of people in the class is given by the user as variable x. Here is the code outline that is needed to answer this question. Please use it in your answer: import mathimport random # create and initialize frequency table:ft = []k = 0while(k < 365) : ft.append(0) k = k+1 # Allow the user to determine class size:print("Please type in how many people are in the class: ")x= int(input()) success = 0 # Simulate:c = 0while(c < 10000) : # Step 1: re-initialize birthday frequency table (it must be re-initialized for each play-through (why?): k = 0 while(k < 365) : ft[k] = 0 k = k+1 # Step 2: randomly get x birthdays and update frequency table: k = 0 while(k < x): # your code goes here ########################## k = k+1 # Step 3: Check to see if this…arrow_forward
- USING JAVA Create a method that randomly select a letter in the alphabet (the random should be in another method including the main method )arrow_forwardJava program I need help creating a program that creates a Christmas tree. It has a method that accepts two parameters (one for the number of segments and one for the height of each segment). The left tree has 3 segments with a height of 4 and the right one has two segments with a height of 5. Can you explain how the for loops would work?arrow_forwardIn python language, including print(song)arrow_forward
- Java - Smallest Numberarrow_forwardAssume we have the library system that contains different books, assume the books have Title and Author. The system should enable the user to view all the books in the library, add a book to the library, remove a book from the library. Hint: Use Array to store books in the library. Tasks: • Implement the Library ADT and test the requirements properly. • FindBook(String title) is a method inside ADT that check if the title of book is exists in the library or not and print a message for the user according to that.arrow_forwardJavaarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education