Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Haskell Script text file ha6.hs and write in that file a complete stand-alone Haskell program that repeatedly inputs English text lines and, for

Create a Haskell Script text file ha6.hs and write in that file a complete stand-alone Haskell program that repeatedly inputs English text lines and, for each input line, outputs the total number of vowels occurring in the palindrome words contained in that line. A palindrome word is one that reads the same when reversed, like noon, level, etc. The program should terminate on an empty input line.

Some notes:

Your program should be case-insensitive, so words like Madam, Noon, etc. should be recognized as palindromes.

For this exercise, you are not allowed to use any built-in Haskell function that has an alphabetic name, like head, tail, zip, words, etc. If you need to use any such function, just develop your own version of it, and call it head', tail', zip', words', etc. (We're all grown-ups now, and should be able to write our own versions :)

It's OK to use any built-in arithmetic functions, like +, -, etc.

It's also OK to use built-in I/O functions, like putStr, print, etc.

A sample program execution may look like (user input is shown in red):

$ runhaskell ha6.s

Text: Wow Anna has a cute racecar !!

7

Text: My mom takes out her kayak boat only on civic holidays.

5

Text: This sentence ain't got no palindromes!

0

Text: I think Ma'am is just a short form of Madam

6

Text:

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

Recommended Textbook for

More Books

Students also viewed these Databases questions