Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will read in from a file named input.txt one line at a time. For each line, print out TRUE or FALSE

image text in transcribed
Write a program that will read in from a file named input.txt one line at a time. For each line, print out TRUE or FALSE depending on if the line is a palindrome. A palindrome is a string of letters or a string of numbers that is the same forward and backwards after the punctuation is removed. For more information on palindromes check out the Wikipedia page G. The program must be written with loops and you should only have your main method. Also, you are not to use regular expression (regex) to solve the problem. If you solve it with regex or methods, you will receive a zero on the assignment and asked to redo it because we have not learned those methods yet, so it typically is because you found code on the internet. Input Type \& Format - The input will come in the form of a file named input.txt - There will be all letters or all numbers with special characters per line in the file. Output Examples: If input.txt is "Madagm I'm Adam. In racecar In boat In 123321 in 1234 " the output would be True True False True False

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

Students also viewed these Databases questions