writing on Haskell plz writing on Haskell plz writing on Haskell plz 1. 2pts) Cr
ID: 3602333 • Letter: W
Question
writing on Haskell plz writing on Haskell plz writing on Haskell plz
1. 2pts) Create a function, using partial application of functions, that sees if a single Int is divisible by 5. It takes in an Int and returns a Bool. (edited from original to be a bit easier)
2. 2pts) Write a function that checks if every other letter of a string is between 'a' and 'f' (the remaining letters don't matter, start with the first letter in the string, skip the second, and so on). The function takes in a String and returns a Bool. Use partial application at least once. Empty string returns True. (edited to specify what empty string returns, some clarification added).
3. 4pts) Write a function that takes two lists, zips them, then maps the result to a list of sums of the numbers in the tuples. E.g., [1, 2, 3] [4, 5, 6] gets zipped to [(1, 4), (2, 5), (3,6)], then gets mapped to [5, 7, 9].
4. 4pts) Write a function that maps a list of Strings that may have multiple words to Strings with only the first word left. E.g. ["Today is Thursday", "Banquet", "unreal games"] becomes ["Today", "Banquet", "unreal"].
5. 4pts) Write a function that takes a two dimensional matrix of Strings and transforms all empty strings to "0".
Explanation / Answer
f n = length evenFactors == length oddFactors where evenFactors = [x | xRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.