Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
160 views
10 pages
CSC305 Question
Question
Uploaded by
Anas Zakwan
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save CSC305_Question For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
160 views
10 pages
CSC305 Question
Question
Uploaded by
Anas Zakwan
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save CSC305_Question For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save CSC305_Question For Later
You are on page 1
/ 10
Search
Fullscreen
CONFIDENTIAL CDISUL 20231CSC305 UNIVERSITI TEKNOLOGI MARA FINAL EXAMINATION COURSE : PROGRAMMING PARADIGMS COURSE CODE : CSC305 EXAMINATION : JULY 2023 TIME 3 HOURS INSTRUCTIONS TO CANDIDATES, 1 This question paper consists of five (5) questions. 2 ‘Answer ALL questions in the Answer Booklet. Start each answer on a new page. 3 Do not bring any material into the examination room unless permission is given by the invigitator. 4, Please check to make sure that this examination pack consists of: j) the Question Paper ji) an Answer Booklet ~ provided by the Faculty 5. ‘Answer ALL questions in English. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO This examination paper consists of 70 printed pages: (© Hak Cipta Universiti Teknologi MARA, CONFIDENTIALCONFIDENTIAL, 2 CDIJUL 202/CSC305 QUESTION 1 a) il) b) ii) Scheme has predicate functions for lists. Give and describe THREE (3) predicate functions that are available in Scheme. (3 marks) Give the output for each of the following Scheme expressions. 4. (reverse '(u k ti ha i d uitm)) 2. (car ‘(car (HandheldGamingConsoles EReaders Smartphones Tablets LaptopComputers SmartWatches})) (2 marks) Construct a Scheme function to solve each of the following mathematical problems. Bab eo Yen 1 5P4 1, sm2n? 3rs Byz 7 2. sy (4 marks) Given the following functions funct1 and funct2, state the mathematical expressions for each function. (define (funct1 x y) (U # y) 3) ) (© Hak Cipta Universit Teknotogi MARA CONFIDENTIAL,CONFIDENTIAL, 3 CDIJUL 2023/CSC305 (define (funct2 p q) (+(funct1 p q) (sqrt q)) ) (4 marks) 9 i) Analyse the diagram of cuboid M and cube N below which has a volume based ‘on the following formula: i N height a fidth Tenath lene Figure 1 volume = length * width * height The height and the width of cube N is the same as the height and width of cuboid M. By using the formula, write the expression in Scheme to find: 1. The length of the cuboid 2. The differences in volume between the two blocks. (4 marks) iil) Afflicious Cookies provide a variety of cookies for Hari Raya Aidilfitri. The table below shows the price and the delivery date of the cookies. West Malaysia (A) Order completed by 7 ppetvery date and Price |Receive before Hari Raya Aidifftr lapril 17, 2023 (1) [RM35 per container [Receive after Hari Raya Aidiihtrt ‘Apri 18,2023 (2) RM30 per container © Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL, 4 CDNUL 2023/¢SC305 East Malaysia (B) [Delivery date and Price Receive before Hari Raya Aidilfitri |april 13, 2023 (3) _[RM40 per container IRecelve after Hari Raya Aidiffitri i144, 2028 (4) _RM35 per container Write a Scheme function that displays the information of the delivery date and price according to the table above. (6 marks) QUESTION 2 a) Based on the given facts in Prolog, predict the output for the following queries: [Eapacity LORRY (cargo, 5650). capacity LORRY (container, 4950). jcapacity_ LORRY (trailer, 8850). capacity LORRY (flatbed, 7480). |capacity LORRY (refrigerated, 2050). (6 marks) © 2+ capacity LORRY ( _, 5650). * 2+ capacity_LORRY (Type, 7480). * 2 capacity LORRY (Type, Capacity), Capacity < 5000. © Hak Cipta Universit Teknolog! MARA CONFIDENTIALCONFIDENTIAL 5 CDIJUL 20281CSC305 b) Consider the following statements: [Maine Coon is a cat. IMikey is a cat. Sherry loves Mikey. Write the facts based on the above statements and create rules for the following statement: + Sherry loves every cat, + Nani loves all Sherry loves. (8 marks) ¢) Based on the following facts: %eroom name, width in feet and length in feet om (living, 18, 20) ‘com (dining, 16, 18) om (kitchen, 12.5, 14.5) oom (master, 12, 16.5) i) Give the output of the following prolog queries: ©? area ( _, _,X), X> 18 ¢ ?- area ( kitchen, A, B) (@ marks) il) Write a rule to caleulate the area of the room. (8 marks) ii) Write a rule to shortlist the room with a length less than 13 and a width less than 15. (4 marks) QUESTION 3 @) Based on the following C program: 6 Hak Cipta Universiti Teknologi MARA CONFIDENTIALCONFIDENTIAL 6 CDIJUL 20281680305 [Line [Code H___#include 2 int main(voidyt B | inti=3; float b = 2.5; while > Of printf("The sum of the Yd and %.2Fis %.2fin", i, b, i#b) Taye i) Identity ONE (1) syntax error and ONE (1) logical error of the codes and rewrite the correct statements. (2 marks) ') Trace the output of the codes afer the errors are corrected. (3 marks) b) Level of Service (LOS) is one of the typical performance measurements of roundabout. Table 1 summarizes the grading criteria of roundabouts using LOS; “A” being ideal free-flow conditions and “F” being inefficient congested conditions. Table 1: Level of Service (LOS) Criteria [evel of Service (LOS) average Control Delay (s/vehicle) E10 70-15 15-25 P 25-36 P 35-60 P50 THY OF OP wy Sy ‘Write a function of C programming that uses if-else statements that would return LOS for a given Average Control Delay as the input argument. (8 marks) (© Hak Cipta Universit Teknologi MARA CONFIDENTIALCONFIDENTIAL 7 CDIJUL 20281CSC305 c) Public survey results of the Top three delicacies in Sarawak are listed in the Table 2. Table 2: Top Three Delicacies in Sarawak Name Rating (75) [Price per bow (Ri) [laksa Sarawak 5 }10.50 Kolo Mee x 6.00 i [Pucuk Midin 8 5.00 ) Create a new struct data type in C program to store the data given. (2marks) 1) Declare an array of the new data type created in (i) and store the data in the array. (2marks) li) Due to the increase in raw maierial costs, write a C program segment to increase the prices of the delicacies by 20% of the original price, (2marks) 'V) Write a C program segment display all the data after the price increase. (2marks) QUESTION 4 a) ABC Automobile Service wants to systemize the registration system for their customers. Each customer must provide a name, identification number, and phone number. Meanwhile, the car model, plate number, and owner's information are needed for each car. The owner is the customer, and each customer may have more than one car registered for the service. Identify the TWO (2) objects and their attributes for the system and the relationship between the objects. (6 marks) b) Define a complete subclass for the class Cylinder based on the class diagram below with normal constructor, accessor, and processor calcVolume(), where cylinder volume is Volume = 7h ‘© Hak Cipta Universit! Teknologi MARA CONFIDENTIALCONFIDENTIAL 8 CDINUL 2028/6305 Circle #radius: double +Cirlce(double) +getRadius():double Cylinder ~ height double +Cylinder(double, double) +getHeight(.double
= 55, SalesPrice is CurrPrice * 0.7. december_sales (ItemName, SalesPrice} :- product (ItemName, CurrPrice) , CurrPrice < 55, SalesPrice is CurrPrice * 0.88. (8 marks) END OF QUESTION PAPER © Hk Cipta Universiti Teknologi MARA CONFIDENTIAL
You might also like
Isp250 Final Report
PDF
No ratings yet
Isp250 Final Report
22 pages
CSC584 Project
PDF
No ratings yet
CSC584 Project
14 pages
Ict450 SQL Exercise Question
PDF
No ratings yet
Ict450 SQL Exercise Question
12 pages
ICT Final Report Final
PDF
100% (1)
ICT Final Report Final
48 pages
Sheet 1 Answers PDF
PDF
No ratings yet
Sheet 1 Answers PDF
18 pages
CSC 126 Project Report
PDF
No ratings yet
CSC 126 Project Report
72 pages
Universiti Teknologi Mara Assessment 1 (Quiz) : Confidential 1 CS/MAY 2022/ST552
PDF
No ratings yet
Universiti Teknologi Mara Assessment 1 (Quiz) : Confidential 1 CS/MAY 2022/ST552
5 pages
Isp250 SDD
PDF
No ratings yet
Isp250 SDD
28 pages
Universiti Teknologi Mara Final Examination: Confidential Cs/Jun
PDF
100% (1)
Universiti Teknologi Mara Final Examination: Confidential Cs/Jun
11 pages
CSC305 - Test 2 (Answer Scheme) Student
PDF
No ratings yet
CSC305 - Test 2 (Answer Scheme) Student
7 pages
Sta116-Final Report (Group Project)
PDF
No ratings yet
Sta116-Final Report (Group Project)
20 pages
Final Year Project
PDF
100% (1)
Final Year Project
30 pages
Indidivual Proposal Assignment CSC264
PDF
No ratings yet
Indidivual Proposal Assignment CSC264
28 pages
Faculty - College of Computing, Informatics and Media - 2023 - Session 1 - Pra-Diploma Dan Diploma - CSC305
PDF
No ratings yet
Faculty - College of Computing, Informatics and Media - 2023 - Session 1 - Pra-Diploma Dan Diploma - CSC305
8 pages
TUTORIAL 6-9 Building The Bagel House Application
PDF
No ratings yet
TUTORIAL 6-9 Building The Bagel House Application
14 pages
Universiti Teknologi Mara Final Assessment: Confidential 1 CS/FEB 2022/CSC580
PDF
No ratings yet
Universiti Teknologi Mara Final Assessment: Confidential 1 CS/FEB 2022/CSC580
4 pages
CSC186 FinalDec2019
PDF
No ratings yet
CSC186 FinalDec2019
20 pages
Quiz 1 With Answer Sta116 Quiz 1
PDF
100% (1)
Quiz 1 With Answer Sta116 Quiz 1
8 pages
ITT300 Individual Assignment (Arief Najib 2022810958)
PDF
No ratings yet
ITT300 Individual Assignment (Arief Najib 2022810958)
6 pages
Discrete Structures (MTK3013)
PDF
No ratings yet
Discrete Structures (MTK3013)
15 pages
CSC577 (Test1) 30042024
PDF
No ratings yet
CSC577 (Test1) 30042024
4 pages
Final Report
PDF
No ratings yet
Final Report
30 pages
Report Lab Test Itt300
PDF
No ratings yet
Report Lab Test Itt300
37 pages
Ict550 Final Assessment
PDF
No ratings yet
Ict550 Final Assessment
4 pages
Universiti Teknologi Mara Csc404 Programming Ii Mini Project: Burger Shop
PDF
No ratings yet
Universiti Teknologi Mara Csc404 Programming Ii Mini Project: Burger Shop
31 pages
Solution Sta116 Part 3
PDF
No ratings yet
Solution Sta116 Part 3
6 pages
CSC204 Test Oct20-Feb21
PDF
No ratings yet
CSC204 Test Oct20-Feb21
14 pages
Test#1csc508 20nov2023
PDF
No ratings yet
Test#1csc508 20nov2023
6 pages
03 Carla-Installation-Guide CARLA Setup Guide Windows x64 PDF
PDF
No ratings yet
03 Carla-Installation-Guide CARLA Setup Guide Windows x64 PDF
22 pages
Test CSC207 20242
PDF
No ratings yet
Test CSC207 20242
10 pages
ICT501 Exercise 6 Joins New
PDF
100% (1)
ICT501 Exercise 6 Joins New
6 pages
Sta116 Group 1 Report
PDF
No ratings yet
Sta116 Group 1 Report
25 pages
Faculty - College of Computing, Informatics and Media - 2023 - Session 1 - Degree - CSC413
PDF
No ratings yet
Faculty - College of Computing, Informatics and Media - 2023 - Session 1 - Degree - CSC413
11 pages
EMS - All Activity Diagram
PDF
No ratings yet
EMS - All Activity Diagram
14 pages
CSC577 (Test2) - 20222 20220620
PDF
No ratings yet
CSC577 (Test2) - 20222 20220620
3 pages
Group Project CSC121
PDF
No ratings yet
Group Project CSC121
7 pages
Isp 550 Use Case Descriptin
PDF
No ratings yet
Isp 550 Use Case Descriptin
9 pages
Test 1csc508 Answer
PDF
No ratings yet
Test 1csc508 Answer
7 pages
CSC583 Artificial Intelligence Algorithms Group Assignment (30%)
PDF
No ratings yet
CSC583 Artificial Intelligence Algorithms Group Assignment (30%)
3 pages
Answers
PDF
No ratings yet
Answers
10 pages
Report csc301
PDF
No ratings yet
Report csc301
21 pages
Hangman Game: Vocabulary Building Flutter App: 1) Background/ Problem Statement
PDF
No ratings yet
Hangman Game: Vocabulary Building Flutter App: 1) Background/ Problem Statement
7 pages
CSP600 Chapter 1 (Ordering Mobile Application)
PDF
No ratings yet
CSP600 Chapter 1 (Ordering Mobile Application)
7 pages
Itt420 - Group 9
PDF
No ratings yet
Itt420 - Group 9
64 pages
Project OOSAD
PDF
No ratings yet
Project OOSAD
19 pages
Universiti Teknologi Mara College of Computing, Information and Media ICT551 Human Computer Interaction
PDF
No ratings yet
Universiti Teknologi Mara College of Computing, Information and Media ICT551 Human Computer Interaction
29 pages
(Isp250) - SDP GP Project (Draft 2)
PDF
No ratings yet
(Isp250) - SDP GP Project (Draft 2)
20 pages
C++ Final Exam
PDF
No ratings yet
C++ Final Exam
1 page
CSC305 LabTestAB Questions
PDF
No ratings yet
CSC305 LabTestAB Questions
5 pages
CSC404 Exam 1
PDF
No ratings yet
CSC404 Exam 1
5 pages
CSC584 Storyboard D'JIA
PDF
No ratings yet
CSC584 Storyboard D'JIA
15 pages
CSP600 Chapter 2 (Ordering Mobile Application)
PDF
No ratings yet
CSP600 Chapter 2 (Ordering Mobile Application)
3 pages
CSC248 Julai 22 Quiz
PDF
No ratings yet
CSC248 Julai 22 Quiz
9 pages
Lab 1 ITT557
PDF
No ratings yet
Lab 1 ITT557
3 pages
Scheme of Work CSC204
PDF
0% (1)
Scheme of Work CSC204
7 pages
LabAssignment DSC650
PDF
No ratings yet
LabAssignment DSC650
5 pages
CSC305 July 21 Questions
PDF
No ratings yet
CSC305 July 21 Questions
8 pages
CSC128 CSC415
PDF
No ratings yet
CSC128 CSC415
11 pages
Project Proposal ITS232 - Dec 2016 - Apr 2017 (2) Deg
PDF
No ratings yet
Project Proposal ITS232 - Dec 2016 - Apr 2017 (2) Deg
16 pages
csc248 Group Assignment
PDF
No ratings yet
csc248 Group Assignment
2 pages