
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
C code for this problem:
![Mr. A really likes palindromes, so he is always looking for character strings that include palindromes. One day he realized
that since pi is an infinite sequence, it might contain a lot of palindromes, and this inspired him to look for palindromes in
large number sequences. As it is not possible to do so manually, he created a program to output the longest palindrome
from an input sequence.
The mission
Build a program to output the longest palindrome from an input number.
What is a palindrome?
A palindrome is a sequence that reads the same backwards as forwards, e.g. madam, 1, 22, 1234321. You can check if
a string A is a palindrome or not by using the pseudo code below.
A == reverse(A)
Implementation details
CLI
CLI
Please implement a CLI application that takes the input value as an argument and outputs the result to standard output.
For details, see the "CLI application template" section at the bottom of this page
Input rules
• The CLI application does not accept arguments.
• A string consisting of numbers between 0 and 9 is given as standard input.
• The length of the string is 1 million or less.
Output rules
• The longest palindrome from an input number is output.
• If there are multiple longest palindromes available, the first one is output as the longest palindrome.
1/0 example
$ ./[YOUR APP] < test/in/basic/basic_testcase01.txt](https://content.bartleby.com/qna-images/question/41e7eb0b-7b62-4629-8082-67c46abae2f0/02d71cd0-b1e0-4afb-9291-d36d1ecaf7f5/2x9adgm_thumbnail.jpeg)
Transcribed Image Text:Mr. A really likes palindromes, so he is always looking for character strings that include palindromes. One day he realized
that since pi is an infinite sequence, it might contain a lot of palindromes, and this inspired him to look for palindromes in
large number sequences. As it is not possible to do so manually, he created a program to output the longest palindrome
from an input sequence.
The mission
Build a program to output the longest palindrome from an input number.
What is a palindrome?
A palindrome is a sequence that reads the same backwards as forwards, e.g. madam, 1, 22, 1234321. You can check if
a string A is a palindrome or not by using the pseudo code below.
A == reverse(A)
Implementation details
CLI
CLI
Please implement a CLI application that takes the input value as an argument and outputs the result to standard output.
For details, see the "CLI application template" section at the bottom of this page
Input rules
• The CLI application does not accept arguments.
• A string consisting of numbers between 0 and 9 is given as standard input.
• The length of the string is 1 million or less.
Output rules
• The longest palindrome from an input number is output.
• If there are multiple longest palindromes available, the first one is output as the longest palindrome.
1/0 example
$ ./[YOUR APP] < test/in/basic/basic_testcase01.txt

Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 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
- C++ CODE ONLY: Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are X₁, X2, X3, X4, and x5, then the mean is X = (X1 + X2 + X3 + x4 + x5 ) / 5 and the standard deviation is: (x₁−x)²+ (x₂-x)²+ (x¸¯x)²+(x¸−x)²+(x¸¯x)² S = 5 Your program must contain at least the following functions: 1. a function that calculates and returns the mean; and, 2. a function that calculates the print standard deviation. Input 1.5 integers Output Enter five numbers: 2 3 9 10 11 The mean is 7.00. The standard deviation is 3.742. Enter five numbers: 7 7 8 9 11 The mean is 8.40. The standard deviation is 1.497.arrow_forwardC++ program to find roots of a Quadratic Equation For a quadratic equation ax2+bx+c = 0 (where a, b and c are coefficients), it's roots is given by following the formula.arrow_forwardC PROGRAM Create a c program that will convert number figures into words 1. You can use user-defined functions, string, array, and loops 2. Maximum input limit is 10000.00 Sample output (bold letters is for input) Enter amount in Peso: 143.50 You just entered P145.50 equivalent to One Hundred Forty Three and Fifty Centavos. Do you want to convert another amount? [Y|N]: Narrow_forward
- C++ Programarrow_forwardProblem Statement The barcode used by the U.S. Postal System to route mail is defined as follows: Each decimal digit in the ZIP code is encoded using a sequence of three half-height and two full-height bars. The barcode starts and ends with a full-height bar (the guard rail) and includes a checksum digit (after the five-digit ZIP code or ZIP + 4), computed by summing up the original digits modulo 10. Define the following functions: Draw a half-height or full-height bar on stddraw. Given a digit, draw its sequence of bars. Compute the checksum digit. Also define global code that read in a five- (or nine-) digit ZIP code as the command-line argument and draws the corresponding postal barcode.arrow_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