Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2 Suppose we have a database for Grade 1 1 and 1 2 students of the Esplanade Secondary School. The layout of the records
Question
Suppose we have a database for Grade and students of the Esplanade Secondary
School. The layout of the records in this database is as follows:
studentSurname FirstName, Gender,Grade, Listofsubjects
The first entry in the list of subjects represents the subject the student takes as first language
and the second entry the subject the student takes as second language. The other entries
represent the other subjects the student takes.
a Write Prolog clauses for the following: Given a Surname and FirstName, return
the list of subjects this student takes, eg
studentsubs Surname FirstName, L should return the list of the subjects
student FirstName Surname takes. Do this for the gender and the grade of the
student as well.
b Build your own database using some entries reflecting the records of students. Use the
Prolog clauses you defined in a to run queries to ask the following questions:
Who takes Portuguese as second language?
Who takes more than subjects?
Is there a student with the surname Brown in Grade
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started