IMAN SOLIKHIN BIN MOHD ZAIMKCS1104C

.pdf
School
Universiti Teknologi Mara**We aren't endorsed by this school
Course
CSC 510
Subject
Computer Science
Date
Dec 29, 2024
Pages
9
Uploaded by SargentKoala4791
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 UNIVERSITI TEKNOLOGI MARA PRACTICAL TEST COURSE :PROGRAMMING PARADIGMS COURSE CODE :CSC305 DURATION :2 HOURS NAME :IMAN SOLIKHIN BIN MOHD ZAIM MATRICS NO :2021452636 GROUP :KCS1104C INSTRUCTIONS TO CANDIDATES 1. This paper contains TWO (2) questions and a scoring rubric. 2. I know that plagiarism is wrong. Plagiarism is to use someone else’s work andpresent it as your own. 3. This assignment/project/test/quiz/final assessment is my own work. 4. I have not been involved, nor will I allow anyone to copy my work with the intention of passing it off as their work. 5. I acknowledge that copying someone else’swork (or part of it) is wrong and declare that my submission is my own. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO This test paper consists of 3 printed pages 100 MARKS
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 PRACTICAL TEST (20%) SUBMISSION GUIDELINE: i. How to answer the question: a. For each of Scheme programming questions, student must: Capture a screenshot of Scheme code written in the text editor as shown below. Students also need to run the function and then call the function in the function call area as shown below. Capture a screenshot of the function area as shown example below: b. For each of Prolog programming questions, student must: If the question related to facts and rules, capture a screenshot of your knowledge base as shown by sample below: SAMPLE SAMPLE
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 If the question related to query, run the query and capture a screenshot of the output as shown below: ii. Label your answer in accordance with the question number. iii. Submission project platform: Google Classroom/ Microsoft Teams(as directed by the group lecturer). SAMPLE
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 QUESTION 1 - SCHEME PROGRAMMING LANGUAGE a. Write a program in Scheme Programming Language to calculate the Electricity Utility Bill. Your program will enter the total units used and determine the total charges of electricity utility bill based on the following table.Total units used Charges The first 100 units RM 25 Next 100 units RM 25 + (unit - 100) * 5 cents Next 100 unit RM 30 + (unit - 200) * 6 cents Next 100 unit RM 36 + (unit - 300) * 7 cents Next 100 unit RM 43 + (unit - 400) * 8 cents Next 100 unit RM 51 + (unit 500) * 9 cents More than 600 units RM 60 + (unit 600) * 10 cents b. Given the following program fragment is written in C programming. Convert the following program fragment into scheme programming language.int functX( int x) { if (x==0) return 0; else if (x==1) return 1; else return (pow(x,3) + functX(x-1)); }
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 c. Write a program in scheme programming language to determine the number that you entered is either even or odd number.
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 QUESTION 2 PROLOG PROGRAMMING LANGUAGE Given the following table results_csc305_test.txt. MatricNum StudName StudProg Group Marks 1001 KHALISH AMIR CS110 KCS1104A 28 1002 QAISARA KHAIRUL CS110 KCS1104B 32 1003 HAKIM HADI CS110 KCS1104A 43 1004 ALI AZMI CS110 KCS1104B 22 1005 HUMAIRA ABDUL CS110 KCS1104B 21 1006 AMANI MUHAMMAD CS110 KCS1104A 39 a. Write the facts (special horn clauses) based on the above table (functor name is results). b. Write a rule (horn clause) to determine the name of students who scored less than 25 marks. (Functor name is scoredless25) c. Write a rule (horn clause) to determine the name and who scored the highest mark. (Functor name is highest)
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 d. Determine the output for each of the following queries. i) results(_,X,_,_,Y), Y > 45. ii) results(_,X,_,_,Y), Y < 30,!. iii) results(_,X,_,’KCS1104A’,Y), Y < 30.END OF QUESTIONS PAPER
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 PRACTICAL TEST RUBRIC (20%) RUBRIC CLO2 / LAB TEST CLO2: Manipulate programming paradigms using programming tools. (PLO3, P3) SCHEME - (A) PROJECT COMPILATION Please state your project status (Choose ONE status best to describe your project status and mark as ‘X’)Selection (Mark as ‘X’)Status Description Score Completed Compiled without error, ran the program with expected output. 10 marks Completed; ran without error Compiled without error, ran the program with unexpected output 7 marks Partial Completed; unable to run Compiled without error, however unable to run the program. 5 marks Incomplete with error Compiled with error. 0 mark TOTAL SCHEME (A) maximum 10 marks0 SCHEME - (B) COMPULSORY CRITERIA Item Not exist (o point) Poor (1 point) Fair (3 point) Good (5 point) Score 1) Variables a. declaration 0 b. definition 0 c. value assignment 0 d. calculation/manipulation 0 2) Functions a. parameter passing 0 b. function call 0 TOTAL SCHEME (B) maximum 30 marks0 PROLOG - (A) PROJECT COMPILATION Please state your project status (Choose ONE status best to describe your project status and mark as ‘X’)Selection (Mark as ‘X’)Status Description Score Completed Compiled without error, ran the program with expected output. 10 marks Completed; ran without error Compiled without error, ran the program with unexpected output 7 marks
Background image
CONFIDENTIAL PRACTICAL TEST / CSC305 / MAY2023 Partial Completed; unable to run Compiled without error, however unable to run the program. 5 marks Incomplete with error Compiled with error. 0 mark TOTAL PROLOG (A) maximum 10 marks0 PROLOG - (B) COMPULSORY CRITERIA Item Not exist (o point) Poor (1 point) Fair (3 point) Good (5 point) Score 1) Facts a. object name 0 b. relationship 0 2) Rules a. value assignment 0 b. calculation/manipulation 0 3) Queries 0 4) Overall syntax 0 TOTAL PROLOG (B) maximum 30 marks0 C) ADDITIONAL CRITERIA Item Not exist (o point) Poor (1 point) Fair (3 point) Good (5 point) Score 1) Originality 0 2) Proper Programming Style 0 3) Creativity 0 4) Answer Submission 0 TOTAL (C) maximum 20 marks0 SUMMARY : SCORING SCHEME PROLOG ( C ) max: 20 marksOVERALL SCORE: max: 100 marksPercentage: ( 20% ) (A) max: 10(B) max: 30(A) max: 10(B) max: 300 0 0 0 0 0 0
Background image