Write the Haskell function that makes a list of students as a parameter and prints out students who are teenagers
Example usage:
?> teenagers = filter isTeenager students
students = [
Student "Jane" 22 True,
Student "John" 16 False,
Student "Peter" 49 True,
Student "Mary" 15 False,
Student "Alex" 18 True,
Student "Paul" 13 False,
Student "Mike" 21 True,
Student "Tom" 17 False,
Student "Lucy" 19 True,
Student "Kevin" 23 False,
Student "Emily" 14 False,
Student "David" 16 True
]
?> teenagers
[Student "John" 16 False,
Student "Mary" 15 False,
Student "Alex" 18 True,
Student "Paul" 13 False,
Student "Tom" 17 False,
Student "Lucy" 19 True,
Student "Emily" 14 False,
Student "David" 16 True]
This is showing 16 years old studying at Flinders University
This is showing 13 years old studying at Melbourne University