CLISP Programming
Posted: Mon Dec 09, 2013 8:24 am
There are two parts of this question and I've managed to do the first part. It's the second part I'm currently having problem with.
1. Create a factbase of students and their CGPA for at least 5 students with CGPA ranging from 2 to 5 with students having the CGPA (4.1) by defining deftemplate facts. The name slot should be STRING type and CGPA slot should be of floating point number.
DONE!!
But how to...
2. Write a rule to find names and their CGPA and display the result on the monitor.
(deffacts students-list
(student (name “A B Câ€) (CGPA 2.0))
(student (name “D E Fâ€) (CGPA 2.5))
(student (name “G H Iâ€) (CGPA 3.0))
(student (name “J K Lâ€) (CGPA 4.1))
(student (name “M N Oâ€) (CGPA 4.1)))
1. Create a factbase of students and their CGPA for at least 5 students with CGPA ranging from 2 to 5 with students having the CGPA (4.1) by defining deftemplate facts. The name slot should be STRING type and CGPA slot should be of floating point number.
DONE!!
But how to...
2. Write a rule to find names and their CGPA and display the result on the monitor.
(deffacts students-list
(student (name “A B Câ€) (CGPA 2.0))
(student (name “D E Fâ€) (CGPA 2.5))
(student (name “G H Iâ€) (CGPA 3.0))
(student (name “J K Lâ€) (CGPA 4.1))
(student (name “M N Oâ€) (CGPA 4.1)))