Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!