Reference no: EM133627438
Haskell -wryte Haskell code and provide a screenshot of your results
Question 1. A function that prints the word "Even" if a parameter passed to the function is even otherwise print the word "Odd".
Question 2. A function that returns the average of 3 numbers (not in a list)
Question 3. write a Haskell function that asks the user for their Name and then prints "Happy Birthday x!!!" where x is their name.
Question 4. write a function that takes a list of strings and another string as parameters. Your function should return a new list with the string appended to the list.
Question 5. write a function that takes a list and prints out all the items in the list.
Question 6. write a recursive function that takes a list and returns the sum of the items in the list.
Question 7. Use a list comprehension to return all the numbers greater than 30 and less than 50 in a list of all even numbers from 0 to 100.
Question 8. write a Haskell function that removes the punctuation and spaces in the following statement. "I am the Lorax, I speak for the trees... Now thanks to your hacking my trees to the ground. There's not enough Truffula fruit to go round!!!"
Use a let statement in main to hold the quote.
Question 9. write a function that uses guards to calculate movie ticket prices. Child tickets cost $7.50, adult tickets are $13.50, and senior tickets are $8.00. The main program should ask which type of ticket the user wants - hard code the number of tickets to avoid the string to int conversion which varies from compilers.