This assignment is due on May 5th.
Fred had published a lonely hearts ad: ``Young guy, tall, smart, is looking for a romantic independent woman.'' He received quite a number of replies, among them was following letter:
``You claim in your ad that you are smart. Hence, I give my age (in full years) in a challenging way. Smart guys can solve that:
In case that my age is an odd number with a cross sum of less than 8, I was not born in Buffalo. If I am younger than 19 or older than 39, at least one of the following two statements, labelled with (a) and (b) is true: (a) My age is divisible by 11. (b) I was born in Buffalo. If the cross sum of my age is not less than 8, it is neither divisible by 3 nor 7. In case that I am older than 18 but younger than 40 and the cross sum of my age is not less then 8, I was born in Buffalo. If my age can neither be divided by 3 nor 7, one and only one of the following two statements is true: The cross sum of my age is not less than 8. I am younger than 19 or older than 39. If my age is a multiple of 11, it has to be odd, and its cross sum is greater or equal to 8. In case my age can neither be divided by 3 nor 7, I was not born in Buffalo, and my age is a multiple of 11. If my age is even, its cross sum cannot be less than 8.''
Write a Prolog program that helps Fred in telling how old that lady is and whether she was born in Buffalo or not.
Source: This problem was published in ``88 neue Logeleien von Zweistein'', Nymphenburger Verlag, 1983, and was translated by me.
Please submit everything in one email that includes all your answers in attachments. Multiple submission emails are permitted but then only the last one is considered.