LAB 5: WORKING WITH DATA

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.

Pengenalan Sistem Maklumat Dalam Pendidikan

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

Lab 4 : Sorting Techniques

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

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

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

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CPT103 Struktur Data & Paradigma Pengaturcaraan

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

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

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

UNIVERSITI SAINS MALAYSIA

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

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

UNIVERSITI SAINS MALAYSIA

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

Panduan Menggunakan Autoresponder FreeAutobot.com

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

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

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

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

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

TEKNOLOGI, GADJET & KEIBUBAPAAN

ASAS SAINS KOMPUTER (ASK) RANCANGAN PELAJARAN TAHUNAN TINGKATAN Disediakan Oleh;

EEE 428 SISTEM KOMPUTER

Persekitaran Pengaturcaraan Arduino

M2U MANUAL PENGGUNA USER MANUAL M2UNHJ. 0 P a g e BAHAGIAN SIMPANAN DAN PENGELUARAN JABATAN KHIDMAT PENDEPOSIT DAN OPERASI LEMBAGA TABUNG HAJI

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

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

RANCANGAN PEMBELAJARAN TAHUNAN 2017 ASAS SAINS KOMPUTER TINGKATAN 1

PANDUAN PENGGUNA (SUPPLIER) e-purchase ORDER FOR SERVICES

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

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

CREATING USER ID AND PASSWORD : NOTA PENTING NOTA PENTING SEBELUM MEMULAKAN PROSES CREATE USER ID & PASSWORD

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

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

Visitor Management System

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

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

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Panduan Guru Maker UNO/ Arduino

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

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

Modul Latihan: Pembangunan Applikasi Pangkalan Data dan JSP Bahagian 1

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

FUZZY NEURAL NETWORKS WITH GENETIC ALGORITHM-BASED LEARNING METHOD M. REZA MASHINCHI UNIVERSITI TEKNOLOGI MALAYSIA

PERU BAHAN PERKHIDMATAN KREDIT DAN PERBANKAN ARAHAN KERJA UNIT KOMPUTER. Tatacara Proses AGM03. BPKP/KJAK-104 Bilangan Semakan : 0 Tarikh :

MSS 318 Discrete Mathematics [Matematik Diskret]

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

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

Panduan Pengguna Autodesk Education Community

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

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

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

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

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

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

EEE 348 PENGANTAR REKABENTUK LITAR BERSEPADU

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

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

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

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

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

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

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

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

UNIVERSITI MALAYSIA SARAWAK KOTA SAMARAHAN SARAWAK

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.

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

MICROSOFT EXCEL. Membina Hamparan Elektronik Fungsi Hamparan Elektronik

BORANG PENCALONAN HADIAH UNIVERSITI NOMINATION FORM FOR UNIVERSITY AWARD

KOLEJ MULTIMEDIA JALAN GURNEY KIRI KUALA LUMPUR

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

MAT181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

PANDUAN PENGGUNA (PENSYARAH)

UNIVERSITI SAINS MALAYSIA. CST334 Network Monitoring & Security [Pengawasan & Keselamatan Rangkaian]

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

AN IMPROVED PACKET FORWARDING APPROACH FOR SOURCE LOCATION PRIVACY IN WIRELESS SENSORS NETWORK MOHAMMAD ALI NASSIRI ABRISHAMCHI

Disediakan oleh: Mohammad Hazmin Bin Mohamed Azri

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

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

ISOGEOMETRIC ANALYSIS OF PLANE STRESS STRUCTURE CHUM ZHI XIAN

CCS592 Advanced Algorithms and Complexity [Algoritma Lanjutan & Kekompleksan]

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

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

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

SMART AQUARJUM (A UTOMATIC FEEDING MACHINE) SY AFINAZ ZURJATI BINTI BAHARUDDIN

Manual Pengguna. PCN Online Service Fulfillment System

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

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

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

1. Akses untuk koperasi adalah melalui

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

Transcription:

LAB : WORKING WITH DATA OBJECTIVES FOR STUDENTS. Identify the difference between integer and floating-point numbers. [Mengenal pasti perbezaan di antara nombor integer dan titik terapung.]. Write arithmetic expressions in C. [Menulis ungkapan aritmetik dalam C.]. Define and initialize variables and constants in C. [Mentakrifkan dan memberi nilai awal kepada pembolehubah dan pemalar di dalam C.]. Write simple programs that assign values to variables, process the values and display the results. [Menulis satu aturcara yang mudah yang dapat mengumpukkan nilai kepada pembolehubah, memproses nilai-nilai tersebut dan memaparkan hasil operasi tersebut.] ASSUMPTIONS. Students have experience in compiling and running a C program. [Pelajar mempunyai pengalaman mengkompil dan melaksanakan aturcara C.] LAB EXERCISES EXERCISE : [LATIHAN ]. Write assignment statements that perform the following operations with variables a, b and c. [Tulis penyataan umpukan yang menjalankan operasi berikut terhadap pembolehubah a, b dan c.] i. Add to variable a and stores the result in b. [Tambah kepada a dan simpan hasilnya dalam b.] ii. Multiply b with and stores the result in b. [Darab b dengan dan simpan hasilnya dalam b.]

LAB : WORKING WITH DATA iii. Divide a by. and stores the result in b. [Bahagi a dengan. dan simpan hasilnya dalam b.] iv. Subtract 8 from b and stores the result in a. [Tolak 8 daripada b dan simpan hasilnya dalam a.] v. Store the value in a. [Simpan nilai dalam a.] vi. Store the character L in c. [Simpan huruf L dalam c.] EXERCISE : [LATIHAN ]. Download Program.. There are a number of syntax errors in the Program.. Locate as many as you can. [Muat turun Program.. Terdapat beberapa ralat sintaks di dalam Program.. Kenalpasti sebanyak yang mungkin.] 8 9 0 //Program. #include <stdio.h> #include <conio.h> int main() { int a,b; a=; b=; c=a+b; printf ("The value of c is %d, c)"; getch(); return 0; }. Explain and correct the errors. [Berikan penerangan tentang ralat sintaks yang dikenal pasti dan betulkan ralat-ralat tersebut.]

BASIC PROGRAMMING C EXERCISE : [LATIHAN ]. Type in the following program (Program.): [Taip aturcara yang berikut (Program.):] 8 9 0 //Program. #include <stdio.h> #include <conio.h> int main() { int length, width, area; } length = ; width = ; area=length*width; printf ("Area: %d", area, "\n"); getch(); return 0;. Compile and run the Program.. What is the output? [Kompil dan laksanakan Program.. Apakah hasilnya?]. In your own words, explain the program. [Di dalam ayat kamu sendiri, berikan penerangan tentang aturcara tersebut.]. Now, modify the Program. by changing the value of length to. and width to.. Compile and run the modified program. What is the output? Explain the output. [Ubah aturcara di dalam Program. dengan menukarkan nilai length kepada. dan width kepada.. Kompil dan laksanakan aturcara yang telah diubahsuai. Apakah hasilnya. Berikan penerangan tentang hasil tersebut.]. Now, change the length and width variable type to float. Compile and run the modified program. What is the output? [Ubah pembolehubah length dan width kepada jenis float. Kompil dan laksanakan aturcara yang telah diubahsuai. Apakah hasilnya?]

LAB : WORKING WITH DATA EXERCISE : [LATIHAN ]. What will be printed by the extracted code below. Explain how you get such output. [Apakah yang akan dicetak oleh cebisan kod di bawah. Terangkan bagaimana kamu boleh mendapat hasil tersebut.] 8 9 0 //Program. int n, m, x, y; m=0; n=m++*; printf ("n: %d", n); printf ("\nm: %d", m); x=0; y=++x*; printf ("\nx: %d", x); printf ("\ny: %d", y);. What is the final value of t? Why such output? Explain the output. [Apakah hasil akhir nilai t? Kenapa hasil tersebut dihasilkan? Berikan penerangan tentang hasil tersebut.] //Program. int j=, k=; double r=., s=.0, t, t; t*=r+s; t=r-s*%(+j)/k;

BASIC PROGRAMMING C EXERCISE : [LATIHAN ]. Convert the following pseudocode (Algorithm.) to C code. [Tukarkan kod sudo berikut (Algorithm.) ke kod C.] Algorithm.: Calculating total sales value for three items. Start. Store.9 in the item variable.. Store.9 in the item variable.. Store.9 in the item variable.. Sum up the three variables and store the result in the subtotal variable.. Multiply the subtotal variable with 0.0 and store the result in the sales tax variable.. Subtract the sales tax amount from the subtotal and store the result in the total variable. 8. Display each item s value, the subtotal value, the amount of sales tax and the total. 9. End. Convert either Algorithm. or Algorithm. (Lab, Exercise, Question ) to C code. [Tukarkan samada Algorithm. atau Algorithm. (Lab, Exercise, Question ) kepada kod C.]. Convert the designed solution for "Get the input values" (Lab, Exercise, Question ) to C code. [Tukarkan penyelesaian yang telah direkabentuk bagi "Get the input values" (Lab, Exercise, Question ) kepada kod C.]. Convert the designed solution for "Calculate the total perimeter" (Lab, Exercise, Question ) to C code. [Tukarkan penyelesaian yang telah direkabentuk bagi "Calculate the total perimeter" (Lab, Exercise, Question ) kepada kod C.] 8

LAB : WORKING WITH DATA EXERCISE : [LATIHAN ]. Write a program that computes the tax and tip of a restaurant bill for a patron with a cost of RM0.0. The tax should be 0% of the meal cost. The tip should be % of the total after adding the tax. Display the cost, tax amount, tip amount and total bill on the screen. [Tuliskan satu aturcara yang akan mengira nilai cukai dan tip untuk bil restoran yang mempunyai nilai kos RM0.0. Cukai ialah 0% daripada kos tersebut. Tip pula ialah % daripada jumlah kos setelah dicampur dengan cukai. Paparkan nilai kos, nilai cukai, nilai tip dan jumlah bil di skrin.]. An electronics company sells circuit boards at a 0 percent profit. Write a program that will calculate the selling price of a circuit board that costs RM.. Display the result on the screen. [Sebuah syarikat elektronik menjual papan litar pada keuntungan 0%. Tuliskan satu aturcara yang akan mengira harga jualan papan litar yang berkos RM.. Paparkan hasil di skrin.] 9