Summary: Program #6 20 points
Don't show your code to anyone in the class. Don't read anyone else's code. Do not
google to find complete solutions to the exercises (as that involves reading someone else's
code). Don't discuss the details of your code with anyone except the tutors, grader, or your
A list is either empty or it is composed of a first element (head) and a tail, which is a list
itself. In Prolog we represent the empty list by the atom  and a non-empty list by a term [H|T]
where H denotes the head and T denotes the tail.
1. (2 points) Find the last element of a list.
X = d
2. (2 points) Find the K'th element of a list.
The first element in the list is number 1.