INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

Similar documents
INSTRUCTION: This section consists of FOUR (4) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi EMPAT (4) soalan. Jawab SEMUA soalan.

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2)short answers and TWO (2) structured essays. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

INSTRUCTION: This section consists of TWO (2) short answer and structured essay questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2)structured questions.answer ALL questions.

INSTRUCTION: This section consists of TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

UNIVERSITI SAINS MALAYSIA. CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CPT113 Programming Methodology & Data Structures [Metodologi Pengaturcaraan & Struktur Data]

UNIVERSITI SAINS MALAYSIA

CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CPT211-CPM313 Programming Language Concepts & Paradigm [Konsep & Paradigma Bahasa Pengaturcaraan]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

PART A SULIT (EKT 221) BAHAGIAN A. Answer ALL questions. Question 1. a) Briefly explain the concept of Clock Gating.

INSTRUCTION: This section consists of TEN (10) structured questions. Answer ALL questions.

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

LAB 5: WORKING WITH DATA

MAT181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

UNIVERSITI SAINS MALAYSIA. CPT111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. Peperiksaan Semester Pertama Sidang Akademik 2003/2004. September/Oktober 2003

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

UNIVERSITI SAINS MALAYSIA. CPT103/ CPM211 Struktur Data & Paradigma Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CPT344 Computer Vision & Image Processing [Penglihatan Komputer & Pemprosesan Imej]

UNIVERSITI SAINS MALAYSIA. CST332 Internet Protocols. Architecture & Routing [Protokol, Seni Bina & Penghalaan Internet]

UNIVERSITI SAINS MALAYSIA. CPT113/CPM213 Programming Methodology & Data Structures [Metodologi Pengaturcaraan & Struktur Data]

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MAT 181 Programming for Scientific Applications [Pengaturcaraan untuk Penggunaan Sains]

UNIVERSITI MALAYSIA SARAWAK KOTA SAMARAHAN SARAWAK

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

UNIVERSITI MALAYSIA PERLIS. DNT 126 Basic Computer Programming [Asas Pengaturcaraan Komputer]

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

Analysis SPM of year 2007, 2008, 2009, 2010, 2011, 2012, 2013 (Section B & C)

...a- JEE ELEKTRONIK DIGIT II. UNlVERSlTl SAINS MALAYSIA. Peperiksaan Semester Kedua Sidang Akademik FebruarVMac 2003.

UNIVERSITI SAINS MALAYSIA. CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih]

EEE348 INTRODUCTION TO INTEGRATED CIRCUIT DESIGN (PENGANTAR REKABENTUK LITAR BERSEPADU)

CPT211/CPM313 Programming Language Concepts & Paradigms [Konsep & Paradigma Bahasa Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CPT103 Struktur Data & Paradigma Pengaturcaraan

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

EEE 428 SISTEM KOMPUTER

UNIVERSITI SAINS MALAYSIA. CPT103/CPM211 Struktur Data & Paradigma Pengaturcaraan

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

Lab 4 : Sorting Techniques

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CCS522 Advanced Data Communication & Computer Networks [Rangkaian Komputer & Komunikasi Data Lanjutan]

EEE 348 PENGANTAR REKABENTUK LITAR BERSEPADU

Bahagian A. Jawab semua soalan. Tulis jawapan anda di ruang yang disediakan pada Helaian Jawapan. Setiap jawapan diperuntukkan satu markah.

Section A Bahagian A. 2 MARK 1 was invented by Harvard University in MARK 1 telah dicipta oleh Universiti Harvad pada tahun...

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

[40 marks] [40 marks] Answer all questions. Jawab semua soalan.

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

COMBINING TABLES. Akademi Audit Negara. CAATs ASAS ACL / 1

CPT212 Design & Analysis of Algorithms [Reka Bentuk & Analisis Algoritma]

DCG3083 : PHOTOGRAMMETRY

KOLEJ MULTIMEDIA JALAN GURNEY KIRI KUALA LUMPUR

PEPERIKSAAN PERCUBAAN SIJIL PELAJARAN MALAYSIA /1

UNIVERSITI SAINS MALAYSIA. CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih]

UNIVERSITI SAINS MALAYSIA. CMT422 Multimedia Information Systems & Management [Sistem & Pengurusan Maklumat Multimedia]

[40 marks] [40 markah] Answer all questions. Jawab semua soalan.

21 II, IV, I, III C (I) Update/insert/delete 34 (II) Book ID (I) Form 34 (II) Report File 36

UNIVERSITI SAINS MALAYSIA. CCS522 Advanced Data Communication and Computer Networks [Rangkaian Komputer dan Komunikasi Data Lanjutan]

UNIVERSITI SAINS MALAYSIA. CST333 Distributed & Grid Computing [Perkomputeran Teragih & Grid]

Pengenalan Sistem Maklumat Dalam Pendidikan

MSS 317 Coding Theory [Teori Pengekodan]

MICROSOFT EXCEL. Membina Hamparan Elektronik Fungsi Hamparan Elektronik

UNIVERSITI SAINS MALAYSIA

PEPERIKSAAN PERCUBAAN SIJIL PELAJARAN MALAYSIA 2009

UNIVERSITI MALAYSIA PERLIS. EKT 120 Pengaturcaraan Komputer [Computer Programming]

UNIVERSITI SAINS MALAYSIA. CIT502 Pengaturcaraan dan Kejuruteraan Perisian Berorientasi Objek

EEM 312 ROBOTIK & PENGLIHATAN MESIN

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

MANAGE COURSE RESOURCES LABEL TEXT PAGE URL BOOK FILE FOLDER IMS CONTENT PACKAGE

UNIVERSITI SAINS MALAYSIA. CMT322/CMM323 Web Engineering & Technologies [Kejuruteraan & Teknologi Web]

ssk 2023 asas komunikasi dan rangkaian TOPIK 4.0 PENGALAMATAN RANGKAIAN Minggu 11

UNIVERSITI SAINS MALAYSIA. CMT324 Computer Graphics & Visual Computing [Grafik Komputer & Perkomputeran Visual]

MSS 318 Discrete Mathematics [Matematik Diskret]

PEPERIKSAAN PERCUBAAN SIJIL PELAJARAN MALAYSIA /1

Pengguna akan diberikan Username dan Password oleh Administrator untuk login sebagai admin/conference Manager bagi conference yang akan diadakan.

CPT113/CPM213 Programming Methodology & Data Structures [Metodologi Pengaturcaraan & Struktur Data]

Section A Bahagian A. [36 marks] [36 markah]

UJIAN PENCAPAIAN SEKOLAH RENDAH 20XX 015/2. MATEMATIK Kertas 2 September 1 jam Satu jam JANGAN BUKA KERTAS SOALAN INI SEHINGGA DIBERITAHU

Jawab semua soalan. Nyatakan nilai digit bagi digit yang bergaris. State the digit value of the underlined digit.

UNIVERSITI SAINS MALAYSIA EEE 355 ROBOT DAN PENGAUTOMATAN

EEE 355 ROBOTIC & AUTOMATION [Robotik & Pengautomatan]

UNIVERSITI SAINS MALAYSIA. CST234 Network Programming [Pengaturcaraan Rangkaian]

PEPERIKSAAN PERCUBAAN TAHUN 2017 TEKNOLOGI MAKLUMAT DAN KOMUNIKASI TINGKATAN 5. KERTAS 1 2½ Jam JANGAN BUKA KERTAS SOALAN INI SEHINGGA DIBERITAHU

PANDUAN PENGGUNA (SUPPLIER) MAINTAIN CERTIFICATES/SUPPLIER DETAILS SUPPLIER RELATIONSHIP MANAGEMENT SUPPLY CHAIN MANAGEMENT SYSTEM (SCMS)

CCS592 Advanced Algorithms and Complexity [Algoritma Lanjutan & Kekompleksan]

UNIVERSITI MALAYSIA PERLIS. EKT 120 Pengaturcaraan Komputer [Computer Programming]

UNIVERSITI SAINS MALAYSIA. CST231/CSM331 Data Communications & Networks [Komunikasi Data & Rangkaian]

Modul Latihan: Pembangunan Applikasi Pangkalan Data dan JSP Bahagian 1

Transcription:

SECTION B : 55 MARKS BAHAGIAN B : 55 MARKAH INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan berstruktur. Jawab semua soalan. QUESTION 1 SOALAN 1 (a) i) Describe TWO (2) types of comment that supported by C++ program. Nyatakan DUA (2) jenis komen yang disokong oleh program C++. ii) Explain THREE (3) types of data used in C++ program. Terangkan TIGA (3) jenis data yang digunakan dalam program C++. (b) i) Identify the most suitable data types for the following variables in Figure B1. Kenalpasti jenis data yang paling sesuai bagi pembolehubah berikut dalam Rajah B1. Age Money Name Grade Variables Figure B1/Rajah B1 Data Type 16 SULIT

ii) By using the answers in (b) (i), write the syntax to declare the variables. Dengan menggunakan jawapan (b) (i), tuliskan sintak pengisytiharaan bagi pembolehubah. [4 marks] [4 markah] iii) Identify the suitable variables for input and output statement based on pseudo code given in Figure B2. Kenalpasti pemboleh ubah yang sesuai untuk kenyataan input dan output berdasarkan psuedo code yang diberikan dalam Rajah B2. Algorithm 1: Determine Sum of two numbers. Start Declare variable/s Read input Operate Sum = a+b Display Sum = End Figure B2/Rajah B2 (c) i) Differentiate these selection statements; if-else and switch. Nyatakan perbezaan bagi pernyataan pemilihan ini; if-else dan switch. ii) State the definition of local and global variables. Nyatakan definisi bagi pembolehubah dalaman dan global. 17 SULIT

iii) Identify the identifier scope for the segment code in Figure B3 below. Kenalpasti skop identifier untuk kod segmen di Rajah B3 di bawah. #include<iostream> int B; FunctionName() int A; /*Block of one or more */ /*C statements*/ Figure B3/Rajah B3 iv) Complete the syntax for switch case statement in Figure B4 below. Lengkapkan sintaks bagi kenyataan switch case di Rajah B4 di bawah. switch (code) 'd': balance = balance + amount; cout << "your balance << balance; ; case 'w': balance = balance - amount; cout << "your balance << ; break; : cout << " code not allowed!\n"; Figure B4/Rajah B4 [4 marks] [4 markah] 18 SULIT

QUESTION 2 SOALAN 2 (a) Describe the following components of array: Jelaskan komponen tatasusunan berikut: (i) (ii) (iii) Index Element Size (b) (i) Define a function. Berikan definisi fungsi. [1 marks] [1 markah] (ii) List TWO (2) types of function. Senaraikan DUA(2) jenis fungsi 19 SULIT

(c) Based on Figure B5, state which LINE is referring to the following: Berdasarkan Rajah B5, nyatakan BARIS yang merujuk kepada berikut: Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10 Line 11 Line 12 Line 13 Line 14 Line 15 Line 16 (i) (ii) #include <iostream.h> int square (int); int main() for (int x = 1; x <= 10; x++) cout << square(x) << " "; cout << endl; return 0; int square (int y) return y * y; Function header Figure B5/ Rajah B5 Function prototype /declaration (d) State ONE (1) example to declare the following: Nyatakan SATU (1) contoh pengisytiharan untuk yang berikut: (i) (ii) (iii) One dimensional array Pointer Structure. 20 SULIT

(e) Write C++ statement for the following: Tuliskan pernyataan C++ bagi yang berikut: i. Declare array name Student of 6 elements of int data type. Isytihar tatasusunan Student yang mempunyai 6 elemen jenis data int. C3 (f) Identify the outputs for Figure B6 shown below. Kenalpasti output bagi Rajah B6 di bawah. #include <iostream.h> int test (int a, int &b); int main () int a=9, b=4; cout<<"the value of a:"<<a<<" and b:"<<b<<endl; test(a,b); int test(int a, int &b) a++; b--; cout<<"the value of a:"<<a<<" Figure B2/ Rajah and B2 b:"<<b<<endl; return 0; Figure B6/ Rajah B6 [4 marks] [4 markah] 21 SULIT

(g) Based on Figure B7, fill in the blanks with the correct answer. Berdasarkan Rajah B7, isikan tempat kosong dengan jawapan yang betul. #include <iostream.h> void main() char letter[ i ] = 'A', 'B', 'C', 'D', 'E', F, G, H, I, J ; for (int i=0;i <10;i++) cout<< ii cout<< endl; Figure B7/Rajah B7 C3 (h) Design and write a program that declares an integer array called lists [5]. Initialize it to some values. Next, declare two pointers variable(one, two). Then assign the address of the lists variable array to the pointer one. Next assign the address stored in pointer one to the two. Lastly, display the value of lists variable array, one and two variable. Tulis program yang mengisytiharkan integer array dipanggil lists [5]. Berikan sebarang nilai kepada element bagi integer array lists[5]. Kemudian, isytihar dua penunding iaitu one dan two serta umpukkan alamat pembolehubah tatasusunan lists kepada penunding one. Seterusnya tentukan alamat yang disimpan dalam penunding one kepada penunding two. Tunjukkan nilai pembolehubah tatasusunan lists, one dan two. [5 marks] [5 markah] 22 SULIT

(i) Based on Figure B8, fill in the blanks with the correct answer. Berdasarkan Rajah B8, isikan tempat kosong dengan jawapan yang betul. #include<iostream> i // function protoype int main() int number, result; number=5; result= ii //function call cout<<"the result is:"<<result<< endl; return(0); int add( iii ) number=number+100; return(number); Figure B8/Rajah B8 C4 (j) Help Ahmad to write a function named Triangle that return float value and accept two float parameters which are base and height. Next, write the formula to calculate the area of triangle in the Triangle function. Bantu Ahmad untuk menulis fungsi yang bernama Triangle yang memulangkan nilai float dan menerima dua parameter float iaitu base dan height. Tuliskan formula untuk mengira luas segitiga di dalam fungsi Triangle. SOALAN TAMAT 23 SULIT