Answered step by step
Verified Expert Solution
Question
1 Approved Answer
HASKELL LANGUAGE 9 pts) Explain list comprehension based on your reading of http:/leamyouahaskell.com/starting- 21 pts) Explain what each of the following lines of code is
HASKELL LANGUAGE
9 pts) Explain list comprehension based on your reading of http:/leamyouahaskell.com/starting- 21 pts) Explain what each of the following lines of code is doing. Record the result. [x+ "ay"| x-[chicken", "soup", "pillow, "music"]] [if even x then "Hello" else "Goodbye" l x -[0.201] Coding Create each fmction in the table. You may use built in fiunctions that you find in Leam You a Haskell. Each function is worth 10 points. Number Desc Takes a list of integers and returns a list of integers where all values have had one added to them. Takes a float and returm a char representing the letter grade based on a standard scale (A if score>90, etc.) Takes a list of floats and returns a list of chars that represent the letter grades based off the original scores Takes a list of floats representing ounces, returns a list of floats where the ounce values have been converted to cup values (1 ounce = 0.125 ame addOne rawGradeToLetter convertRawsToLetters ouncesToCups Takes a list of floats representing ounces of water consumed, returns a list of floats represent the number of glasses of water consumed glassOfWater = 8 ounces) hydrated Takes a float representing the number of ounces of water consumed, converts it glasses of water, if glasses of water is greater than 8 return the string "Hydrated" else return Not Takes a float representing the number of ounces of water consumed, converts it to glasses of water, returns the number of glasses that need to be consumed (as a float) to be considered hydrated (8 ted" waterNeeded ssesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started