Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Haskell (Functional Programming) Must use Haskell 3) Write a function that takes

ID: 3573928 • Letter: H

Question

Haskell (Functional Programming)

Must use Haskell

3) Write a function that takes as input a string and a character and returns True if the character is in the string.

4) Create a list of pairs, each consisting of a month index and corresponding string. Save to a variable "months".

5) Write a "dispMonths" function that takes as input an index argument and returns the corresponding string.

6) Call the dispMonth function with an index and display the month string that's returned in reverse.

7) Write a function that receives the first and last names of someone and returns the initials.

8) Write a list comprehension that produces a list of all numbers from 50 to 100 whose remainder when divided by 7 is 3.

9) Write a list comprehension that generates a list of all numbers from 1 to 20, except for the numbers 3, 14 and 19.

10) Write a function onlyUpper that takes as input a string and uses a list comprehension to filter everything except uppercase letters. Use a range as a predicate for the filter.

Explanation / Answer

multiple questions : asnwering one (3):

cFound :: Char -> String -> Bool
cFound c "" = False
cFound c (x:xs)
| c == x = True
| otherwise = cFound c xs

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote