Information Technology Reference
In-Depth Information
Tania got more answers right than Teresa did. Tom got more right than Tim. Tony
did not get all the answers right, nor did he get them all wrong. Write a Prolog
program to find the correct answers to the quiz.
Hint: Write a predicate grade (
)
that holds when n
is the number of correct answers when a student submits the s i , and the correct
answers are the a i .(So grade counts the matches between the s i and a i .)
s 1 , s 2 , s 3 , s 4 , s 5 , a 1 , a 2 , a 3 , a 4 , a 5 , n
7.
Consider a course timetable for a Fine Arts student at a mythical university.
The student wants to take a course in art, music, film, and dance, and each of
these has three hours of classes a week. To accommodate a variety of timing
constraints, some courses offer two sections at different times.
There are two possible sections for art. One is offered MWF10, and the other,
MWF11.
There is a single section of dance: Friday 1-4.
Music can be taken either Monday at 11, Wednesday at 3, and Friday at 3, or
Monday at 2, Wednesday at 2, and Friday at 11.
There are two sections of film: one on Monday at 11, Wednesday at 11,
and Friday at noon, and one on Monday at noon, Wednesday at noon, and
Wednesday at 3.
In addition, the student wants a free hour for lunch each day at noon or at 1.
Write a Prolog program that generates a timetable for the student.
 
Search WWH ::




Custom Search