KOLEJ MULTIMEDIA JALAN GURNEY KIRI KUALA LUMPUR

Similar documents
UNIVERSITI MALAYSIA SARAWAK KOTA SAMARAHAN SARAWAK

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

KOLEJ MULTIMEDIA JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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

UNIVERSITI SAINS MALAYSIA

CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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

KOLEJ MULTIMEDIA JALAN GURNEY KIRI KUALA LUMPUR

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

UNIVERSITI SAINS MALAYSIA. CPT103 Struktur Data & Paradigma Pengaturcaraan

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

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

UNIVERSITI MALAYSIA SARAWAK KOTA SAMARAHAN SARAWAK

EEE 428 SISTEM KOMPUTER

Pengenalan Sistem Maklumat Dalam Pendidikan

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

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

MAT181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

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

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

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

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

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

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

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

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

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

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

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

LAB 5: WORKING WITH DATA

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

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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

MICROSOFT EXCEL. Membina Hamparan Elektronik Fungsi Hamparan Elektronik

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

MSS 318 Discrete Mathematics [Matematik Diskret]

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

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

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

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

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

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

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

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

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

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

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 TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

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

UNIVERSITI SAINS MALAYSIA. CCS521 Advanced Distributed Systems Concepts and Design [Konsep dan Reka Bentuk Sistem Teragih Maju]

EEE 348 PENGANTAR REKABENTUK LITAR BERSEPADU

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

Panduan Menggunakan Autoresponder FreeAutobot.com

Panduan Guru Maker UNO/ Arduino

Information Security Management System ISO/IEC 27001:2013

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

PENGENALAN KEPADA ALGORITMA & STRUKTUR DATA

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

PANDUAN PENGGUNA (PENSYARAH)

B,8 PERKHIDMATAN KREDIT DAN PERBANKAN. Pemindahan Data PROSEDUR UNIT KOMPUTER. BPKP/KlOK-117 Bilangan Semakan : 0 Tarikh : PERUBAHAN.

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

PANDUAN PENGGUNA (PENTADBIR SYSTEM/SYSTEM ADMINISTRATOR) (INFOTECH, BPPF DAN POLIS

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

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

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

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

1. Threats bermaksud ancaman, atau lebih dikenali sebagai malware (malicious

MSS 317 Coding Theory [Teori Pengekodan]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

FIRST TIME LOGIN & SELF REGISTRATION USER GUIDE LOG MASUK KALI PERTAMA & PENDAFTARAN SENDIRI PANDUAN PENGGUNA

DOKUMEN TIDAK TERKAWAL

UNIVERSITI SAINS MALAYSIA. CMT224/CMM221 Multimedia Systems [Sistem Multimedia]

UNIVERSITI SAINS MALAYSIA. CPT212 Design & Analysis of Algorithms [Reka Bentuk & Analisis Algoritma]

PANDUAN PENGGUNA (SUPPLIER) e-purchase ORDER FOR SERVICES

PENGELUARAN PERAKUAN KEKOMPETENAN DAN PERAKUAN KECEKAPAN BARU MENGIKUT STCW 1978, SEPERTI PINDAAN

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

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

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

TEKNOLOGI, GADJET & KEIBUBAPAAN

JABATAN PERKHIDMATAN AWAM MALAYSIA

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

GARIS PANDUAN PERMOHONAN IMBUHAN PENERBITAN JURNAL / PROSIDING / SITASI BERINDEKS SCOPUS

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

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

Manual Pengguna. PCN Online Service Fulfillment System

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

EEM 312 ROBOTIK & PENGLIHATAN MESIN

UNIVERSITI SAINS MALAYSIA. CIT502 Pengaturcaraan dan Kejuruteraan Perisian Berorientasi Objek

Registration of Supplier (ROS) TM Supplier Registration Renewal via SUS Portal (Pembaharuan Pendaftaran Pembekal TM melalui SUS Portal)

Visitor Management System

5. All fields are compulsory and MUST be filled up. For fields that do not apply to you, please put as N/A (not applicable).

Transcription:

KOLEJ MULTIMEDIA JALAN GURNEY KIRI 54100 KUALA LUMPUR SECOND SEMESTER EXAMINATION, 2010/ 2011 SESSION PSD 2143 INTRODUCTION TO PROGRAMMING II NOR QUSIAH ABDUL RAZAK / ZAKRI MD SALLEH / AZNANI DAUD INSTRUCTION TO STUDENT 12 APRIL 2011 2.30 PM 5.00 PM (2 ½ Hours) 1. This Examination paper has FIFTHTEEN (15) printed pages. 2. This question paper consists of FOUR (4) sections. Section A : Answer ALL questions. Section B : Answer ALL questions. Section C : Answer ALL questions. Section D : Answer ALL question 3. Please write all your answers in the Answer Booklet provided.

PERATURAN PEPERIKSAAN MULTIMEDIA KOLEJ PENYELEWENGAN AKADEMIK 1. Pelajar tidak boleh melakukan mana-mana penyelewengan di bidang akademik seperti berikut atau sebarang arahan peperiksaan yang dikeluarkan oleh Ketua Pengawas Peperiksaan. HUKUMAN 1.1 Pelajar yang meniru hasil kerja orang lain atau tidak mengiktiraf kerja orang lain (plagiat) untuk tujuan tugasan atau ujian akan dikenakan tindakan tatatertib. 1.2 Pelajar juga tidak dibenarkan bersubahat dalam peniruan atau penipuan yang dinyatakan dalam para 1.1. 1.3 Pelajar perlu juga mematuhi peraturan lain mengenai penilaian yang dinyatakan secara lisan atau bertulis. 1. Sekiranya pelajar didapati telah melakukan pelanggaran mana-mana daripada peraturan peperiksaan ini, setelah dibicara dan sabit kesalahannya, maka jawatankuasa Disiplin Pelajar boleh mengambil tindakan dari mana-mana satu, atau apa-apa kombinasi yang sesuai dari dua atau lebih hukuman-hukuman berikut:- (a) sama ada memberimarkah '0' kepada peperiksaan akhir bagi mata pelajaran berkenaan atau memberi markah sifar '0' bagi keseluruhan keputusan peperiksaan mata pelajaran yang berkenaan. (Termasukkerjakursus); (b) Menggantung pengajian pelajar selama tempoh yang difikirkan patut oleh Jawatankuasa Disiplin; (c) Dikenakan hukuman atau denda; (d) lain-lain hukuman yang akan ditetapkan oleh Jawatankuasa Disiplin Pelajar Kolej 2. Pelajar yang melanggar peraturan juga boleh diambil tindakan tatatertib mengikut peruntukan yang terdapat dalam Peraturan & Tatatertib Pelajar, KLT,2000. Dikeluarkan oleh Unit Peperiksaan & Unit Kemasukan dan Rekod Pelajar, Kolej Multimedia, Kuala Lumpur, Julai 2001 NQAR/ZMS/AD Page 2 of 15

BAHAGIAN A : SOALAN OBJEKTIF (10 Markah) SECTION A : OBJECTIVE QUESTIONS (10 Marks) ARAHAN : Jawab SEMUA Soalan INSTRUCTION : Answer ALL Question 1. Apakah keupayaan C++ yang mempunyai kebolehan yang besar berbanding dengan C? What feature in C++ improves the capability of programmers as compared to C? A. Object-structured-programming (OSP) B. Object-oriented-programming (OOP) C. Oriented-based-programming (OBP) D. Oriented-variable-programming (OVP) 2. Syntax C++ yang manakah adalah betul? Which C++ syntax is correct? A. cout << \nthis is the answer ; B. cout >> \nthis is the answer ; C. cout ( \nthis is the answer ); D. cout >> ( \nthis is the answer ); 3. Tatasusunan dengan empat (4) baris dan tujuh (7) lajur mempunyai unsur. A four (4) rows and seven (7) columns array has a total of elements. A. 11 B. 28 C. 20 D. 32 NQAR/ZMS/AD Page 3 of 15

4. Bagaimanakah nilai di masukkan ke dalam array bolehubah dua-dimensi? How do you declare value in a two-dimentional array variable? A. array1[2][3] = ((1,2,3),(4,5,6)); B. array1[2][3] = {{1,2,3,{4,5,6; C. array1[2][3] = ((1,2),(3,4),(5,6)); D. array1[2][3] = {{1,2,{3,4,{5,6; 5. Yang manakah diantara penyataan berikut TIDAK benar? Which of the following statements is NOT correct? A. Array adalah struktur data yang mempunyai jenis data yang sama. Arrays are data structure consisting of related data items of the same type. B. Array adalah entity yang static iaitu saiz array tidak berubah apabila program dilancarkan. Arrays are static entities in that they remain the same size throughout program execution. C. Array adalah satu lokasi memori berkumpulan yang berkaitan dengan pelbagai nama dan jenis data. An array is a group of memory locations related by the fact that they all have different name and different data type. D. Array melingkumi di dalam memori. Pengguna menyatakan jenis elemen dan bilangan elemen di dalam array supaya komputer boleh menyimpan bilangan memori yang mencukupi. Arrays occupy space in the memory. You specify the type of each element and the number of elements in the array so that the computer may reserve the appropriate amount of memory. NQAR/ZMS/AD Page 4 of 15

6. Pertimbangkan segmen kod di bawah: Consider the following code segment: char String[15] = Beautiful ; Apakah nilai bagi String[4]? What is the value of String[4]? A. a B. u C. t D. i' 7. Yang manakah antara berikut adalah pengistiharan pointer? Which of the following is the declaration of pointer? A. int x; B. int &x; C. ptr x; D. int *x; 8. Yang manakah antara berikut memberikan elemen pertama tatasusunan sales bagi alamat memori, dengan 50 elemen tatasusunan? Which of the following gives the memory address of the first element in array sales, an array with 50 elements? A. sales[1]; B. sales; C. sales[0]; D. &sales; NQAR/ZMS/AD Page 5 of 15

9. Untuk menggunakan samada fail input atau output, program mestilah memasukkan. To use either input or output file, the program must include the. A. <ofstream> B. <ifstream> C. <fstream> D. <iostream> 10. Apakah fungsi yang digunakan untuk input data menggunakan papan kekunci? What is the function will used to input data using keyboard? A. printf B. cout C. cin D. scanf NQAR/ZMS/AD Page 6 of 15

BAHAGIAN B : BETUL (B) ATAU SALAH (S) (10 Markah) SECTION B : TRUE (T) OR FALSE (F) (10 Marks) ARAHAN : Jawab SEMUA soalan INSTRUCTION : Answer ALL questions 1. Structure adalah koleksi beberapa variables yang menggunakan nama sama. Structure mungkin mempunyai variable-variable yang pelbagai jenis data type. Structures are collection of related variables under one name. Structures may contain variables of many different data types. 2. Pembolehubah dalam C++ boleh bemula dengan angka. A C++ identifier can start with a digit. 3. Jika pengistiharan adalah int marks[ ] = {75, 45, 80, 60; maka saiz tatasusunan marks adalah 5. If declaration is int marks[ ] = { 75, 45, 80, 60; then the size of array marks is 5. 4. Fungsi cin dalam program C++ adalah sama dengan fungsi scanf dalam program C. cin function in C++ program is the same with scanf function in C program. 5. Indeks terakhir di dalam tatasusunan yang mempunyai 35 elemen ialah 35. The last index number in any array with 35 elements is 35. 6. Elemen yang ke tujuh bagi tatasusunan C merujuk kepada c[6]. The seventh element of an array C is referred to as C[6]. 7. Penyataan for (x=0; x<=9; x++) akan melaksanakan gelung sebanyak sembilan kali. The for (x=0; x<=9; x++) statement will execute the loop for nine (9) times. NQAR/ZMS/AD Page 7 of 15

8. Operator & digunakan untuk mengistiharkan pembolehubah pointer dan untuk mengakses ruang memori yang mana point pembolehubah pointer. The operator & is used to declare a pointer variable and to access the memory space to which a pointer variable points. 9. Ahli-ahli didalam struktur boleh terdiri dari jenis data yang berlainan. Structure members can be of different data types. 10. Takrifan pointer bagi nptr berjenis float ditulis seperti berikut adalah sah. Define a pointer of nptr type float as follows is valid: f loat *nptr; NQAR/ZMS/AD Page 8 of 15

BAHAGIAN C : JAWAPAN PENDEK (50 Markah) SECTION C : SHORT ANSWER (50 Marks) ARAHAN : Jawab SEMUA soalan INSTRUCTION : Answer ALL questions Soalan / Question 1 a) Apakah output bagi program berikut : What is the output of the following program : #include<iostream.h> int main() { int item1 = 7; int item2[5] = {0,1,2,3,4; int item3[2][2] = {{1,2,{3,4; cout << "Item 1 =" << item1 << endl; cout << "Item 2 =" << item2[3]<< endl ; cout << "Item 3 =" << item3[0][1]; (6 markah/marks) b) Diberi takrifan data bagi suatu tatasusunan dua (2) dimensi Number yang mempunyai empat (3) baris dan enam (6) lajur. Given the data definition for Number the two dimensional array which contain 3 row and 6 column as: int Number [3][6] = {30, 06, 07, 02, 16, 09 Apakah nilai bagi unsure berikut? What is the value for the following element? 12, 21, 05, 10, 17, 22 17, 12, 13, 08, 11, 03 ; i) Mark [1][3] ii) Mark [0][5] iii) Mark [2][6] iv) Mark [2][2] (4 markah/marks) NQAR/ZMS/AD Page 9 of 15

Soalan / Question 2 Berikan output bagi keratan aturcara berikut: Give the output for the following program segment: a) char *s1 = ABCDE char *s2 = ABC if (strcmp(s1,s2) < 0) printf( %s < %s \n,s1,s2); else printf( %s >= %s \n,s1,s2); (4 markah/marks) b) void main( ) { int x = 30, y = 50; int *j, *k; j = &x; k = &y; *k = *j + 40; x = x + *j; printf( j is %4d and k is %4d\n, *j, *k); printf( x is %4d and y is %4d\n, x, y); (6 markah/marks) NQAR/ZMS/AD Page 10 of 15

Soalan / Question 3 a) Aturcara berikut mengandungi beberapa ralat sintaksis. Cari dan tulis semula program yang betul. The following programs have few syntax errors. Find the errors and rewrite the correct programs. i) #include [iostream] int main() int num1; num2; total int answer; cout <="Enter first number"; cin >>num1; cout >>"Enter second number"; cin >> num2; total = num1 + num2; cout << total; cin >> answer; if(answer = total) { cout <<"True"; else { cout <<"False"; (5 markah/marks) ii) #include {iostream int main ( int even:odd:number cout >>"Enter number:" cin <<number if(number %2==0) cout >>"Your number is even" ) else cout >>"Your number is odd" cout <<"\n" return 0; (5 markah/marks) NQAR/ZMS/AD Page 11 of 15

Soalan / Question 4 a) Berikan output bagi program berikut : Give the output for the following programs : #include<iostream.h> int main() { int i=100; int *j=&i; int &k=*j; cout << "value i is " << i + k << endl; cout << "value j is " << 2 * k - k << endl; (5 markah/marks) b) Perhatikan keratan aturcara berikut. Tunjukkan output sekiranya n=5. Have a look at the following program segment. Show the output if n=5. #include<iostream.h> int main() { int n,i,total; cout<<"enter value greater than 0 "<<endl; cin>> n; i =n-1; total = 0; while (i!= 0) { jumlah += i; i--; cout<<total<<endl; (5 markah/marks) NQAR/ZMS/AD Page 12 of 15

Soalan / Question 5 a) Berikan output bagi keratan program berikut : Give the output for the following programs segment : i) cout << "Before using showpoint \n" << "1.1100 prints as: " << 1.1100 << endl ; ii) cout << showpoint << "After using showpoint \n" << "1.1100 prints as: " << 1.1100 << endl ; iii) cout << "Use std::left to left justify:\n" << left << setw( 10 ) << 12345<< endl; iv) cout << "Use std::right to right justify:\n" << right<< setw( 10 ) << 12345 << endl; v) cout << uppercase << 123abc << endl; (10 markah/marks) NQAR/ZMS/AD Page 13 of 15

BAHAGIAN D : KAJIAN KES - (30 markah) SECTION D : CASE STUDY - (30 marks) ARAHAN : Jawab SEMUA soalan sahaja. INSTRUCTION : Answer ALL questions. Soalan / Question 1 Tulis sebuah program yang akan menggunakan sequential-access file. Program tersebut akan menyimpan rekod pelajar dan markah peperiksaan yang diperolehi. Berikut adalah diperlukan di dalam program ini. Write a program which uses a sequential-access file. The program will keep records of students and their exam score. The following required in the program:- a) Program memerlukan 4 boleh ubah/array seperti berikut:- Nama boleh ubah Jenis data Nota icnumber double No IC Pelajar name[30] char Nama Pelajar subject[30] char Matapelajaran diambil pelajar score integer Markah yang diperolehi The program shall have 4 variables/array which are as follows:- Variable name Data type Note icnumber double Student s IC number name[30] char Student s Name subject[30] char Subject taken by student score integer Mark obtained for subject b) Data fail yang direka oleh program ini dinamakan exam.txt. The data file created by the program is called exam.txt. c) Untuk keluar dari program ini petunjuk -1 digunakan. The program must have an -1 indicator to exit the program. d) Contoh output adalah seperti berikut: Example of the records written in the file are as follows:- NQAR/ZMS/AD Page 14 of 15

(20 markah/marks) Soalan / Question 2 Tulis sebuah program yang membaca dalam jejari bulatan dan mencetak diameter, lilitan, dan kawasan bulatan. Gunakan nilai 3.142 untuk π. Pastikan output jelas berlabel. Contohnya, jika pengguna memasukkan 15, output anda adalah seperti berikut: Write a program that reads in the radius of a circle and prints the circle s diameter, circumference, and area. Use the constant value 3.142 for π. Be sure that the output is clearly labeled. For example, if the user enters 15, your output should be as following: Note: The formula for the Circumference (C) and Area (A) of a circle are : C= 2πr and A= πr 2 (10 markah/marks) End of Page NQAR/ZMS/AD Page 15 of 15