subject

Lab 12B: Palindromes with Files Overview
This is a demonstration of reading and writing files.
Objectives
Be able to read from an input file, perform string manipulation on each line of the file, and write to an output file.
Provided input file:
A single input file named something like myinput. txt is provided that contains a few lines of text.
Description
Create a program to read each line of an input file, determine if the text on the line is a palindrome, and write "palindrome' or 'not a palindrome' to the output file depending on the input. Recall from lab 16.23 that a palindrome is a word or a phrase that is the same when read both forward and backward. In this program, you need to ignore spaces when determining if a phrase is a palindrome. Examples are: 'bob," "sees," or "never odd or even" (ignoring spaces).
You will read the line from a text file, use a function called palindromeChecker to determine if the line is a palindrome. Your function should take a string and return either the string palindrome or not a palindrome, as applicable.
You will write the results to a text file and display the results to the user as shown below.
You may refer to labs 8C and 13B and reuse your code from those labs, as applicable.
Sample Output to the file from the Provided Input File
palindrome
palindrome
not a palindrome
palindrome
not a palindrome
palindrome
Sample Output to the User from the Provided Input File
bob ==> palindrome
sees ==> palindrome
over the moon ==> not a palindrome
never odd or even ==> palindrome
statistics ==> not a palindrome
dr awkward ==> palindrome

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:10
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
You know the right answer?
Lab 12B: Palindromes with Files Overview
This is a demonstration of reading and writing fil...
Questions
question
Mathematics, 12.05.2021 22:20
question
Mathematics, 12.05.2021 22:20