SUBJECT: AI-PROGRAMMING MIDDLE TECHNICAL UNIVERSITY TECHNICAL ENG. COLLEGE-BAGHDAD DEPARTMENT OF MECHATRONICS CLASS: THI
Posted: Mon Jun 06, 2022 6:40 pm
QUESTIONS Q1) (A) Write a prolog program to find the mod of integer number of different numbers. (8) Write a prolog program to find the average of even numbers of integer list. Then test the program for the following list: (2,4,7,8, 10, 11, 12, 15, 18). (20 Mark) Q2) (A) Write a prolog program to find number of times that given integer occurs within a given list of integers, such as: occur[[1,2,3,7,7,4,71,7,X), X=7. (B) Write a prolog program to find the summation of ODD numbers and summation of EVEN numbers of integer list, then test the program for (1,3,5,2,4,6). (20 Mark) Q3) (A) Write a prolog program to find the sum of even numbers of integer list, then test the program for a list of: (11, 12, 13, 14, 15, 16). (B) Write a prolog program to print out the power of integer number (N", K is natural), then test the program for (2"). (20 Mark) Q4) (A) Write a Lisp program that find the value of Z, where: (A+B)/(B+C) Z = , and test for [A-8, B=1, C=1, D=1, E=1, F=2]. D+(E+F) [Use function definition method] (B) Write the machine representation of S-expressions for the following list that is written in lisp language. ((CODE) (CODE X2) (CODE X3 ) ) (20 Mark) Continue to Page | 2 >>>>> Page 1 الكلية التقنية المندسية (
SUBJECT: AI-PROGRAMMING MIDDLE TECHNICAL UNIVERSITY TECHNICAL ENG. COLLEGE-BAGHDAD DEPARTMENT OF MECHATRONICS CLASS: THIRD DATE: 6 / 6 /2022 ACADEMIC YEAR 2021-2022 TIME: 3 HOURS FINAL TERM EXAM P#1 LECTURER: DR. SAFAA KH. LEABI NOTE: ANSWER FIVE OF THE FOLLOWING