rmmict.files.wordpress.com · web view(spm 2008) 2. write the word that would complete the...

80
1 SMK RAJA MUDA MUSA BESTARI JAYA SELANGOR INFORMATION & COMMUNICATION TECHNOLOGY NAMA : …………………………………….. TINGKATAN : 5 …… LEARNINGAREA (5) PROGRAMMING [email protected] ( http://rmmict.blogspot.com )

Upload: truongxuyen

Post on 16-Apr-2018

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

1

SMK RAJA MUDA MUSA

BESTARI JAYA SELANGOR

INFORMATION &COMMUNICATION TECHNOLOGY

NAMA : ……………………………………..

TINGKATAN : 5 ……

LEARNING AREA (5) PROGRAMMING

[email protected] ( http://rmmict.blogspot.com )

Page 2: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

2

5.1 Basic Programming Concepts5.1.1 Define Program and Programming Language5.1.1.1 State the definition of program.5.1.1.2 State the definition of programming language.

SECTION A

1. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.A programming language is a set of rules that can be used to tell a computer what tasks to carry out.Bahasa pengaturcaraan adalah set aturan yang boleh digunakan untuk memberitahu komputer apa tugas untuk dilaksanakan..........................

(SPM 2008)

2. Write the word that would complete the following statement:Tulis perkataan yang akan melengkapkan penyata berikut:

(SARAWAK 2011)A set of words, symbols, and codes that enables human to communicate with computers is known as a / an …………………………………………Satu set perkataan, simbol dan kod yang membolehkan manusia berkomunikasi dengan komputer dikenali sebagai ...............................................................

3. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu. (N.SEMBILAN 2011)

A programming language is a set of words, symbols and codes that enableshumans to communicate with computers.Bahasa Pengaturcaraan adalah satu set perkataan-perkataan, simbol-simbol

dankod-kod yang membolehkan manusia berkomunikasi dengan komputer....................................

4. State whether the following statements is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu. (SELANGOR

2011)i. Programming is a series of organized instruction that directs a computer

to perform task. ………………………….Pengaturcaraan adalah satu siri arahan yang mengarahkan dianjurkan komputer untuk melaksanakan tugas.................................

[email protected] ( http://rmmict.blogspot.com )

Page 3: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

3

ii. Programming language is a set of words, symbols and codes that enables humans to communicate with computer……………………….Bahasa Pengaturcaraan adalah satu set perkataan, simbol dan kod yang membolehkan manusia berkomunikasi dengan komputer..................

5. Which of the following is the correct definition of programming language?Antara yang berikut, yang manakah definisi yang benar bagi bahasa pengaturcaraan?

(KEDAH 2011)a. A programming language is a series of organised instructions that

directs a computer to perform a task.Bahasa pengaturcaraan adalah koleksi arahan yang tersusun yang mengarahkan komputer untuk melakukan tugas.

b. A programming language is a creation of a set of commands or instructions which directs a computer in carrying a task.

Bahasa pengaturcaraan adalah satu set peraturan atau arahan yang dihasilkan untuk mengarahkan komputer dalam menjalankan tugas.

c. A programming language is a set of words, symbols and codes that enables humans to communicate with computers.

Bahasa pengaturcaraan adalah koleksi pernyataan, simbol dan kod yang membolehkan manusia untuk berkomunikasi dengan komputer

d. A programming language is an instruction that can be translated into assembly language and then executed by a computer.

Bahasa pengaturcaraan adalah arahan yang boleh diterjemahkan ke dalam bahasa penghimpun dan kemudian dilaksanakan oleh komputer(no 21)

6. A Programming language is a set of …………………………………………………Bahasa Pengaturcaraan adalah ……………………………………………………

(WILAYAH 2011)

A. computer program that translates a high-level language intomachine language program komputer yang menterjemahkan bahasa peringkat tinggi kepada bahasa mesin

B. words, symbols and codes that enables human to communicate withcomputer perkataan, simbol dan kod yang membolehkan manusia untuk berkomunikasi dengan komputer

C. the combination of text, audio, graphic, video and animationkombinasi teks, audio, video grafik, dan animasi

D. series of step by step instructions telling the computer what to do.siri langkah demi arahan langkah yang memberitahu komputer apayang perlu dilakukan.

[email protected] ( http://rmmict.blogspot.com )

Page 4: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

4

5.1.2 Levels and Generations Of Programming Languages5.1.2.1 Identify the generations of low-level programming languages with examples.

SECTION A

1. Table 2 shows the criteria of two generations of low-level programming languages. Jadual 2 menunjukkan kriteria dua generasi bahasa pengaturcaraan aras rendah.

(SPM 2010)

x. human-readable notation / nota yang boleh dibaca. use symbolic instruction codes / menggunakan kod arahan simbolik

Y. instructionsc an be executedd irectly by CPU / arahan boleh dilaksanakante rus oleh CPO. uses binary code / menggunakanko d binari

Table2 / Jadual 2

Based on Table2 , name the generation of programming language for:Berdasarkan Jadual 2 , namakan generasi bahasa pengaturcaraan untuk:(i) X ……………………………………….(ii) Y ……………………………………….

2. Table 9 shows a list of programming languages.Jadual 9 menunjukkan senarai bahasa pengaturacaraan.Match the correct answer for statement (i) and (ii) from Table 9. Write H, I, J or K.Padankan jawapan yang betul dengan pernyatan (i) dan (ii) dari Jadual 9. Tulis H, I, J atau K.

(PULAU PINANG – HSBM 2011)

i. The source code is written in binary.Kod sumber ditulis dalam binary.

…………………………….

[email protected] ( http://rmmict.blogspot.com )

Page 5: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

5

3. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.

(PERAK 2011)

An assembly language programmer writes instructions using symbolic instruction codes……………………Pengaturcaraan bahasa penghimpun menulis arahan menggunakan kod arahan Simbolik………………

4. Which of the following is Low-Level Programming Language? Manakah antara berikut Bahasa Pengaturcaraan Aras Rendah?

(SELANGOR 2011)A Natural Language

Bahasa TabiiB Assembly Language

Bahasa Himpunan C Procedural Language

Bahasa ProsedurD Non-Procedural Language

Bahasa Bukan Prosedur.

5. Statements below shows the criteria of two generations of low-level programming languages.Pernyataan di bawah menunjukkan 5riteria dua generasi bahasa pengaturcaraan aras rendah.

(MELAKA 2011)

P : instructions can be executed directly by CPUarahan boleh dilaksanakan terus oleh CPU

: uses binary codeMenggunakan kod binary

Q : human readable notationnota yang boleh dibaca

: use symbolic instruction codesmenggunakan kod arahan simbolik

Based on statements above, name the generation of programming language for :Berdasarkan pernyataan di atas, namakan generasi bahasa pengaturcaraan untuk :(i) P ………………………………..(ii) Q ………………………………..

[email protected] ( http://rmmict.blogspot.com )

Page 6: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

6

6. Figure 6 shows the categories of programming languages.Rajah 6 menunjukkan kategori bahasa pengatucaraan.

(SPM 2011)

Figure 6 / Rajah 6Based on Figure 6, identify Z.Berdasarkan Rajah 6, kenal pasti Z.………………………….

[email protected] ( http://rmmict.blogspot.com )

Page 7: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

7

5.1.2.2 Identify the generations of high-level programming languages with examples.

SECTION A

1. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau palsu.

Program written using high level programming language must be translated into machines language before execution.Atur cara yang ditulis menggunakan bahasa pengaturcaraan aras tinggi mesti diterjemahkan ke dalam bahasa mesin sebelum dilaksanakan.…………………………

(SPM 2009)

2. Table 9 shows a list of programming languages.Jadual 9 menunjukkan senarai bahasa pengaturacaraan.Match the correct answer for statement (i) and (ii) from Table 9. Write H, I, J or K.Padankan jawapan yang betul dengan pernyatan (i) dan (ii) dari Jadual 9. Tulis H, I, J atau K.

(PULAU PINANG – HSBM 2011)

TThe programming language that allows people to interact with computers without needing any specialised knowledge.Bahasa pengaturcaraan yang membolehkan manusia berinteraksi dengan komputer tanpa memerlukan kepakaran dalam pengetahuan yang tertentu. …………………….

3. Complete the following statements by filling in the blanksIsikan tempat kosong untuk melengkapkan pernyataan berikut:

(PERAK 2011)A …………………… level programming language is more easier to use and allow more people to interact with computers.Bahasa pengaturcaraan aras ……………………….. lebih mudah digunakan dan membolehkan ramai manusia berinteraksi dengan komputer.

4. Write the correct words to complete the following statements. Tuliskan perkataan yang betul untuk melengkapkan pernyataan berikut.

[email protected] ( http://rmmict.blogspot.com )

Page 8: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

8

(TERENGGANU 2011)(i) ……………………….. generation language uses a series of English-like

words that are closer to human language to write instructions. Bahasa generasi ……………………….. menggunakan satu siri perkataan mirip Bahasa Inggeris yang lebih hampir dengan bahasa manusia untuk menulis arahan.

(ii) ………………………..language allows user to interact with computers without needing any specialized knowledge. Bahasa ………………………..membenarkan pengguna untuk berinteraksi dengan komputer tanpa memerlukan pengetahuan khusus.

5. State whether the following is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.

(KEDAH 2011)Table 3 shows the generations of programming languages with example.Jadual 3 menunjukkan generasi bahasa pengaturcaraan dengan contohnya.

Generation/Generasi Example/ContohThird Generation /Generasi Ketiga COBOLFourth Generation /Generasi Keempat SQLFifth Generation/Generasi Kelima Visual Basic

Table 3/Jadual 3………………………

6. Figure 6 shows examples of programming language.Rajah 6 menunjukkkan contoh bahasa pengaturcaraan.

(WILAYAH 2011)

Figure 6/Rajah 6

Identify the example of High-Level Programming LanguageKenalpasti contoh Bahasa Pengaturcaraan Aras Tinggi.…………………………………………………………….

5.1.3 Programming Language [email protected] ( http://rmmict.blogspot.com )

Procedural Language

Natural

Language

Non procedural Language

Page 9: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

9

5.1.3.1 Define structured approach in programming.

SECTION A

1. Write the words that would complete the following statement:Tulis perkataan yang dapat melengkapkan pernyataan berikut:

(PERAK 2011)……………………………………….. approach is a computer programming technique in which the program is divided into modules.Pendekatan ………………………………………..adalah teknik pengaturcaraan komputer di mana aturcara dibahagi kepada beberapa modul.

2. State whether the following statements is True or False. Nyatakan sama ada pernyataan berikut adalah Benar atau Palsu.

(PERLIS 2011)Structured programming often uses a top down design model. Pengaturcaraan berstruktur menggunakan model rekabentuk atas bawah. …………………….

3. The following statements are relatecl to the characteristics of structuredprogramming exceptPernyataan berikut adalah berkaitan dengan ciri-ciri pengaturcaraanberstruktur kecuali

(SPM 2011)A Main program is broken down into smaller moclules.

Program utama dipecahkan kepada modul-modul yang lebih kecil.B Procedures in the program are reusable.

Prosedur-prosedur dalam program boIeh diguna semula.C Sub procedure inherits methods and attributes from procedure.

Sub prosedur rnewarisi kaedah-kaedah dan atribut-atribut daripada prosedur

D Data and procedure are not kept together.Data dan prosedur tidak disimpan bersama.

5.1.3.2 Define object-oriented approach in programming.

SECTION A

1. Which is the following characteristics are related to an object-oriented programming approach.Yang mana merupakan ciri-ciri berkaitan dengan pendekatan pengaturcaraan berorientasikan objek.

(SPM 2008)

[email protected] ( http://rmmict.blogspot.com )

Page 10: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

10

I. Main routine is broken into smaller sections.II. Data and instructions are seperatedIII. Data and instructions are encapsulated into a single unitIV. The programming language is event-drivenI. rutin utama dipecah menjadi bahagian-bahagian yang lebih kecil.II. Data dan arahan dipisahkanIII. Data dan arahan diencapsulated ke dalam satu unitIV. Bahasa pengaturcaraan adalah event-driven

A. I and IIB. I and IVC. II and IIID. III and IV

2. The ……………………………………………………… refers to a special type of programming approach that combines data with functions to create objects.……………………………………………………… merujuk kepada jenis pendekatan pengaturcaraan istimewa yang menggabungkan data dengan fungsi untuk mencipta objek.

(PULAU PINANG –HSBM 2011)

3. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau palsu.

(KELANTAN 2011)Object oriented programming (ooP) usually uses top down design model.Pengaturcaraan berorientasikan obj ek (OOP) biasanya menggunakan modeI rekabentuk atas bawah.………………….

4. Statement 3 shows programming approach.Pernyataan 2 menunjukkan pendekatan pengaturcaraan.

(N.SEMBILAN 2011)S refers to a special type of programming approach that combines data with functions to create objects.S merujuk kepada sejenis pendekatan pengaturcaraan khusus yang menyatukan data dengan fungsi untuk mencipta objek.

Statement 3/Penyataan 3Based on Statement 3, identify SBerdasarkan Penyataan 3, kenalpasti S………………………………………..

5. The programming approach that combines data with functions as an object is called ................................Pendekatan pengaturcaraan yang menggabungkan fungsi dan data sebagai satu objek dinamakan ................................

(KEDAH 2011)[email protected] ( http://rmmict.blogspot.com )

Page 11: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

11

6. State whether the following statement is True or False.Nyatakan pernyataan berikut Benar atau Palsu

(WILAYAH 2011)

5.1.3.3 Differentiate between structured approach and object-oriented approach in programming.

SECTION A

1. Figure 4 shows programming approaches. Rajah 4 menunjukkan. pendekatan pengaturcaraan.

(JOHOR 2011)

Figure 4 /Rajah 4 Based on Figure 4, state / Berdasarkan Rajah 4, nyatakan (i) P ……………………………………. (ii) Q …………………………………….

SECTION B

1. Every year the school coop will give dividend to its members. Aidel is given a task to build a program to calculate it. He uses Microsoft Visual Basic programming language to complete his task.Setiap tahun koperasi sekolah akan 11ember dividen kepada ahli-ahlinya. Kamal diminta untuk membina program mengira dividen tersebut. Beliau menggunakan bahasa pengaturcaraan Microsoft Visual Basic untuk menyiapkan tugasannya.

(MELAKA 2011)

[email protected] ( http://rmmict.blogspot.com )

Object Oriented Approach is a computer programming technique based on the concept of an “object” that combine modules like function, subroutine and procedure into a single unit........................Pendekatan Berorientasikan Objek adalah teknik pengaturcaraan komputer yang berdasarkan konsep "objek" yang menggabungkan modul seperti fungsi, subrutin dan prosedur ke dalam unit satu................................

Page 12: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

12

Give the difference between the structured programming approached and the programming language that Kamal used.Berikan satu perbezaan di antara pendekatan pengaturcaraan berstruktur dan bahasa pengaturcaraan yang Aidel gunakan. (2 marks/2 markah)........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

2. Table 2 shows programming language approaches. Jadual 2 menunjukkan bahasa pendekatan pengaturcaraan..

(SELANGOR 2011).

Table 2 / Jadual 2

Match the translator with the following statement by writing S or T. Padankan penterjemah dengan pernyataan berikut dengan menulis S atau T.

(i) Programmer packages the data and function into a single unit andobject…………….Pengaturcara mempakej data dan fungsi ke dalam satu unit tunggal dan objek.....................

(ii) Programmer divides programming problem into module like function………

Pengaturcara membahagikan masalah pengaturcaraan ke dalam modul seperti fungsi................

5.1.4 Translator5.1.4.1 Describe the translation method of programming using assembler, interpreter and compiler.

SECTION A

1. Table 3 shows the characteristics of a pieqe of software, S, is used to run a program written in aprogramming larguage. Jadual 3 menuniukkan ciri-ciri sebuah perisian, S,.yang digunakan untuk melaksanakan sebuah program yang ditulis dalam bahasa pengaturcaraan.

[email protected] ( http://rmmict.blogspot.com )

SSTRUCTURED APPROACHPendekatan Berstruktur

TOBJECT-ORIENTED APPROACHPendekatan Berorentasikan Objek

Page 13: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

13

(SPM 2010)- read statement and converts to object code baca pernyataan dan tukar kepada kod objek.- execute line by line

melaksanakan baris demi barisTable 3 / Jadual 3

S is / S adalah

A an assembler / penghimpun B a compiler / pengkompilasiC an interpreter / pentafsir D a translator / penterjemah

2. Figure 10 shows the process of translator.Rajah 10 menunjukkan proses penterjemah.

(PULAU PINANG – HSBM 2011)

State translator Z. / Nyatakan penterjemah Z.…………………………………………..

3. Table 3 shows methods of programming language translation.Jadual 3 menunjukkan kaedah penterjemahan bahasa pengaturcaraan

(KELANTAN 2011)

[email protected] ( http://rmmict.blogspot.com )

Page 14: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

14

Table3 / Jadual 3State the type of translator to be used.Nyatakan jenis penterjemah yang digunakan……………………………………………

4. Which of the following statement describe interpreter?Manakah di antara yang berikut menerangkan penterjemah?

(N.SEMBILAN 2011)A. Translate the source code and no object file is stored in secondary

storage.Menterjemah kod sumber dan tiada objek fail yang disimpan dalam storan sekunder.

B. Create an executable file. Mencipta fail boleh-laksana.

C. Translates entire programming statement of a program into machine language.Menterjemah keseluruhan pernyataan pengaturcaraan kepada bahasa mesin.

D. Store machine language as object code on the disk. Menyimpan bahasa mesin sebagai kod objek di dalam cakera

5. State whether the following statements is True or False. Nyatakan sama ada pernyataan berikut adalah Benar atau Palsu.

(PERLIS 2011)

(ii) Compiler executes instruction in a program line by line until the end of the program. Pengkompil melaksanakan arahan aturcara baris demi baris sehingga tamat aturcara.………………………………….

6. Choose the correct statement regading Interpreter in programming language.Pilih pernyataan yang betul tentang Penterjemahan dalam bahasa pengatucaraan.

(PAHANG 2011)A. Translate mnemonic representation to machine language.

Menterjemahpewakilanmnemonikkepadabahasamesin.B. Execute program directly from its source code.

Laksana program secaraterusdarikodsumber.C. Translate source code and create an executable file.

Menterjemah kod sumber dan mengujudkan fail pelaksana.D. Translate assembly code to machine code.

Menterjemah kod himpunan kepada kod [email protected] ( http://rmmict.blogspot.com )

Page 15: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

15

7. Table 3 shows the characteristics of a piece of software, X is used to run a program Written in a programming language.Jadual 3menunjukkan ciri-ciri penterjemah bagi suatu program, X digunakan untuk melaksanakan sebuah program yang ditulis dalam bahasa pengaturcaraan.

(PAHANG 2011)X

Creates a source codeMenghasilkankodsumber

Run faster than other translatorMenterjemahlebihlajuberbandingpenterjermah lain

Based on Table 3, X is BerdasarkanJadual 3, X adalahA a compiler / PengkomplisiB an interpreter / PentafsirC a translator / PenterjemahD an assembler / penghimpun

8. The table shows the process of implementing a program written in a programming language.Jadual menunjukkan proses untuk melaksanakan sebuah program yang ditulis dalam bahasa pengaturcaraan.

(MELAKA 2011)

……is a program that translates a high-level language into machine language. Translates programming statement of a program into machine language; no object code is saved and then executes it immediately

Merupakan satu program yang menterjemahkan bahasa peringkat tinggi kepada bahasa mesin. Menterjemahkan pernyataan pengaturcaraan program ke dalam bahasa mesin; tiada kod objek disimpan dan kemudian melaksanakan dengan serta-merta

Berdasarkan kepada jadual ini, ia merujuk kepada;Based on this table, it refers to; A. An interpreter / PentafsirB. An assembler / Penghimpun

[email protected] ( http://rmmict.blogspot.com )

Page 16: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

16

C A compiler / PengkompilasiD. A translator / Penterjemah

9. Write the correct words to complete the following statement : Tulis perkataan yang betul untuk melengkapkan pernyataan berikut :

(MELAKA 2011)(i)…………………………….. is used to interpret and execute program directly from its source code without compiling it first. While the (ii)…………………………….. will convert the assembly language into machine code which is a file consisting of binary machine code that can be executed on a computer.

(i)…………………………….. digunakan untuk menterjemah dan melaksana aturcara secara terus daripada kod sumbernya tanpa mengkompil terlebih dahulu. Sementara (ii)…………………………….. akan menterjemahkan bahasa penghimpun ke kod mesin yang merupakan fail yang mengandungi kod mesin binari yang akan dilaksanakan pada komputer.

SECTION B

1. The following is a statement on translator.Berikut adalah pernyataan tentang penterjemah.

(SELANGOR 2011)

Based on the statement above, answer question below:Berdasarkan pernyataan diatas, jawab soalan berikut:

(a) State two translation method of programming.Nyatakan dua kaedah penterjemahan dalam pengaturcaraan.……………………………………….. & ……………………………………

[2 marks]

(b) Describe one translation method of programming that mention on (a).Terangkan satu kaedah penterjemahan dalam pengaturcaraan seperti

[email protected] ( http://rmmict.blogspot.com )

“The program is run through a computer, using a translator program. The translator attempts to translate the written program from the programming language into the machine language.”“Sesebuah program dilaksanakan menerusi komputer menggunakan program penterjemah. Penterjemah akan menterjemahkan program yang telah ditulis dari bahasa pengaturcaraan kepada bahasa mesin”

Computing Essentials, 2006

Page 17: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

17

dinyatakan pada (a). [2marks]

………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………

2. Figure 7 shows the process of two types of translator X and Y.Rajah 7 menunjukkan proses bagi dua jenis penterjemah X dan Y.

(KEDAH 2011)

Figure 7 / Rajah 7Based on Figure 7: / Berdasarkan Rajah 7:

(a) Name translator:Namakan penterjemah: (i) X : ………………………………….

[1mark](i) Y : …………………………………. [1

mark](b) Explain the translator X.

Terangkan penterjemah X.......................................................................................................................................................................................................................................................................................................................................................

(2 mark)

3. Every year the school coop will give dividend to its members. Aidel is given a task to build a program to calculate it. He uses Microsoft Visual Basic programming language to complete his task.Setiap tahun koperasi sekolah akan 17ember dividen kepada ahli-ahlinya. Kamal diminta untuk membina program mengira dividen tersebut. Beliau menggunakan bahasa pengaturcaraan Microsoft Visual Basic untuk menyiapkan tugasannya.

(MELAKA 2011)b) Describe the translation method(s) of programming language used

above. Terangkan kaedah terjemahan yang digunakan pada bahasa pengaturcaraan di atas...................................................................................................................

[email protected] ( http://rmmict.blogspot.com )

Program Statements in High Level Language

Pernyataan Aturcara dalam Bahasa Aras Tinggi

X

Y

Object Code Saved

Kod Objek Disimpan

Machine Language

Bahasa Mesin

Page 18: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

18

..................................................................................................................

..................................................................................................................

..................................................................................................................

( 2markah).

4. Figure 8 shows the methods of programming language translator.Rajah 8 menunjukkan kaedah-kaedah penterjemah bahasa pengaturcaraan.

(EXAM 2011)

Figure 8 / Rajah 8

(a) Give the name of Y and Z Berikan nama Y dan Z ……………………………………………………………………………. [2

markah](b) Explain briefly how the assembler works.

Terangkan secara ringkas bagaimana penghimpun berfungsi …………………………………………………………………………….…………………………………………………………………………….

[2 markah]

5.1.5 Basic Elements In Programming

SECTION A1. Table 3 shows the elements in flow chart. Jadual 3

menunjukkan elemen-elemen dalam carta alir(PERLIS 2011)

Table 3 / Jadual 3 Based on Table 3, write P, Q, R, S or T to match the following statements. Berdasarkan Jadual 3, tuliskan P, Q, R, S atau T bagi pernyataan berikut.

[email protected] ( http://rmmict.blogspot.com )

Tanslator /Penterjemah

Assembler /Penghimpu

nY Z

Page 19: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

19

(i) shows the beginning or end of a program. ………..Menunjukkan permulaan atau penamat sesuatu program. ……………

(ii) Use to connect symbols and indicate the sequences of operation. ………Digunakan untuk menyambungkan simbol dan menunjukkan jujukan …………..sesuatu operasi.

2. Figure 11 below are symbols of the main elements in a flow chart . Rajah 11 di bawah adalah simbol elemen utama dalam carta alir.

(P.PINANG-HSBM 2011)

Based on Figure 11, state the name of the symbols; Berdasarkan Rajah 11, nyatakan nama simbol ; i) X : ………………………………….. ii) Y : ..…………………………………

3. The following statements refer to element in a flow chart.Pernyataan berikut merujuk kepada elemen dalam carta alir.

(SELANGOR 2011)

Draw the element above./Lukis elemen diatas.

[email protected] ( http://rmmict.blogspot.com )

Shows an input operationMenunjukkan operasi input

Showing the result of the programMenunjukkan hasil daripada program

Page 20: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

20

4. Figure 12 is a flow chart using symbols.Rajah 12 menunjukkan carta alir menggunakan simbol-simbol.

(PAHANG 2011)

Figure 12 / Rajah 12

a) Based on the figure above, name X and Y symbol. Berdasarkan rajah di atas, namakan simbol X dan YX ……………………….. Y …………………………………….

[2 markah]b) Verify the usage of X and Y.

Kenalpasti kegunaan X dan Y.X ……………………….. ……………………………………………………………Y ………………………………………………………………………………………

[2 markah]5.1.5.1 Differentiate between constants and variables.

SECTION A

1. Chooset he correct statementsr egardingv ariablesa nd constants. Pilih pernyataan yang betul tentang pemboleh ubah dan pemalar.

(SPM 2009)I. Variables are identifiers / Pemboleh ubah adalah pengecamII. Constants are identifiers / Pemalar adalah pengecamIII. Variables are assigned values that may change / Pemboleh ubah

digunakan untuk nilai yang boleh berubahIV. Constants are assigned values that may change / Pemalar digunakan

untuk nilai yang boleh berubahA I, II and III. / I, II dan III B I, II and IV / I, II dan IVC I. III and IV / I, III dan IV D II, III and IV / U, ilI dan IV

[email protected] ( http://rmmict.blogspot.com )

Y

Begin

Request mark from program

Mark >=50?

End

Print ““Congratulati

ons”

Print “ Don’t give

up!”

X

Page 21: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

21

2. Write the correct words to complete the following statement: Tulis perkataan yang betul untuk melengkapkan pernyataan berikut:

(SPM 2010)

During the execution of a program the value of a (i)………………………. can be changed whereas the value of a (ii) ……………………… cannot be changed.Semasa aturcara dilaksanakan nilai sesuatu ( i ) ………………………… boleh diubah sedangkan nilai untuk (ii) ................... tidak boleh diubah.

3. Figure 9 shows an incomplete program. Rajah9 menunjukkan at urcara yang tidak lengkap.

(SPM 2010)Dim Name as XDim PI as YName = "Ali"PI = 3.142

Figure 9 / Rajah 9

Based on Figure 9 , identify; / Berdasarkan Rajah 9 , kenalpasti:Y= …………………………….

4. Figure 12 shows part of programming code Total Parking Charges.Rajah 12 menunjukkan sebahagian daripada kod atur cara Total Parking Charges.

(PULAU PINANG –HSBM 2011)

Figure 12 / Rajah 12Based on 12 figure, state one :/Berdasarkan rajah 12, nyatakan satu :i. Variable / Pembolehubah :

……………………………………

5. Figure 5 shows an algorithm to calculate the total of x and y.Rajah 5 menunjukkan algoritma untuk mengira jumlah x dan y.

[email protected] ( http://rmmict.blogspot.com )

Page 22: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

22

(PERAK 2011)

Figure 5 / Rajah 5Based on Figure 1, / Berdasarkan Rajah 1,

Name one variable.Namakan satu pembolehubah.

…………………………………………………….

6. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau palsu.

(KELANTAN 2011)(ii) Salleh declares variable in his programme as follows :

Salleh mengistiharkan pembolehubah dalam aturcaranya seperti berikut :

…………………….7. Figure 7 shows some parts of a program code

Rajah 7 menunjukkan sebahagian daripada kod pengaturcaraan.(SPM 2011)

Figure 7 / Rajah 7Based on Figure 7, identify: /

BerdasarkanRajah 7, kenal pasti.(i) integer variable

Pembolehubah integer………………………………………………………………………………………………………

SECTION B

[email protected] ( http://rmmict.blogspot.com )

BEGIN1. Read X and read Y2. Total = X+Y3. Print TotalEND

Const disc= 0.8Const n = 500Dim unit as IntegerDim Price as DoubleDim amt as DoubleIf x > 5 Or rice > n Then amt = price * disc * unitElse

amt= price * unitEnd if

Page 23: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

23

1. Figure 12(a) shows the input interface and Figure 12 (b) shows the output interface of a program.Gambar 12 (a) menunjukkan antara muka input dan Gambar 12 (b) menunjukkan antara muka output dari sebuah program..

(SPM 2009)

Based on Figure l2(a) and Figure I2(b), Berdasarkan Rajah 12(a) dan Rajah I2(b),(i) Should the Numerator declared as a constant?

Patutkah Numerator itu diisytiharkan sebagai pemalar?…………………….NO

(ii) Give a reason for your answer./Beri satu alasan bagi jawapan anda.………………………………………………………………………………………………………………………………………………………………

SECTION C

1. As an ICT student, Azizah is asked to develop a program to calculate the volume of water to be filled in an aquarium. The aquariums length is 120 cm and the width is 50 cm. The user will key in the height or level of water to be filled in the aquarium. Maximum level of water is 60 cm. The program will calculate and display the volume of water needed based on the water level entered by user.

Sebagai pelajar ICT, Azizah diminta membangunkan aturcara yang dapat mengira isipadu air yang perlu diisi ke dalam akuarium. Diberi panjang dan lebar akuarium ialah 120 cm dan 50 cm. Pengguna perlu memasukkan ketinggian atau aras air yang akan diisi kedalam akuarium. Aras air maksimum ialah 60 cm. Aturcara ini akan mengira dan memaparkan isipadu air yang diperlukan berdasarkan ketinggian air yang dimasukkan oleh pengguna

(N.SEMBILAN 2011)[email protected] ( http://rmmict.blogspot.com )

Page 24: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

24

a. State two variables used in this program. Nyatakan dua pembolehubah yang digunakan dalam aturcara ini.Justify your answer.Berikan justifikasi jawapan anda.……………………………………………………………………………………..……………………………………………………………………………………..……………………………………………………………………………………..……………………………………………………………………………………..

(3m)

2. Figure 11 shows goods on sale in a shop.Rajah 11 menunjukkan barang-barang jualan murah di sebuah kedai.

(SELANGOR 2011)

Figure 11 / Rajah 11

Based on Figure 11, you are asked to develop a program to calculate the final price of each item.Berdasarkan Rajah 11, anda dikehendaki membina satu program untuk menghitung harga muktamad setiap barang. (a) Identify two variables.

Kenalpasti dua pemboleh ubah.Justify your answer. Berikan justifikasi anda.……………………………………………………………………………………..……………………………………………………………………………………..……………………………………………………………………………………..……………………………………………………………………………………..

[3 marks]

3. Figure 16 shows a holiday package in a web site.

[email protected] ( http://rmmict.blogspot.com )

25% Discount

Page 25: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

25

Rajah 16 menunjukkan pakej percutian dalam satu laman web. (PERLIS 2011)

Figure 16 / Rajah 16 Based on Figure 16, you are asked to develop a program to calculate the final package price of each destination. Berdasarkan Rajah 16, anda dikehendaki membina satu program untuk mengira harga akhir bagi setiap pakej destinasi. (a) (i) Identify two variables that you need to declare.

Kenalpasti dua pemboleh ubah yang perlu diisytihar. ……………………………………. & …………………………………………

(ii) Justify your answer. Berikan justifikasi anda. …………………………………………………………………………………..…………………………………………………………………………………..…………………………………………………………………………………..

[3 marks]

4. Figure 7 below shows a portion of a Visual Basic coding to calculate the area of rectangle.Rajah 7 menunjukkan sebahagian kod pengaturcaraan Visual Basic pengiraan luas segiempat.

(WILAYAH 2011)

Figure 7/Rajah 7

Based on figure 7, / Berdasarkan rajah 7,i. State two elements of variables

Nyatakan dua elemen pembolehubah` a. .............................................

b. .............................................5.1.5.2 Differentiate between the data types: Boolean,integer, double, string and date.

[email protected] ( http://rmmict.blogspot.com )

Private Sub Command1_Click()Dim Length, Height, Area As DoubleLength = Val (txtLength.Text)Height = Val (txtHeight.Text)Area = Length * WidthlblArea = ‘The Area of Rectangle is ‘ & AreaEnd Sub

Page 26: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

26

SECTION A

1. Table 3 shows some types of data. Jadual 3 menunjukkan beberapa jenis data.

(SPM 2009)

Table.3 / Jadual 3Based on Table 3, state the types of data for:Berdasarkan Jadual 3, nyatakan jenis data untuk:(i) R ……………………… boolean(ii) S ……………………… integer

2. Figure 9 shows an incomplete program. / Rajah9 menunjukkan at urcara yang tidak lengkap.

(SPM 2010)Dim Name as XDim PI as YName = "Ali"PI = 3.142

Figure 9 / Rajah 9Based on Figure 9 , identify; / Berdasarkan Rajah 9 , kenalpasti:X= ………………………………………

3. Choose the best answer according to the data types.Pilih jawapan terbaik berdasarkan jenis data yang disenaraikan.

(PULAU PINANG –HSBM 2011)

i. …………………………data type contains any whole number value that does not have any fractional part.………………………… jenis data yang mengandungi keseluruhan nilai nombor kecuali nombor pecahan.

ii. Any value that contains a sequence of characters is refer to …………………

[email protected] ( http://rmmict.blogspot.com )

Page 27: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

27

Sebarang nilai yang mengandungi jujukan aksara adalah merujukkepada …………………………

4. What is the type of data in Figure 8 below?Apakah jenis data dalam Rajah 8 di bawah?

(KELANTAN 2011)

Figure 8 / Rajah8

…………………………….

5. Figure 6 shows an example of a cinema ticket Rajah 6 menunjukkan contoh tiket panggung wayang

(N.SEMBILAN 2011)

Figure 6 Rajah 6

Based on Figure 6, identify data types for D and E.Berdasarkan Rajah 6, kenalpasti jenis data untuk D dan ED – ..................................E – ..................................

6. Figure below shows an incomplete program.Rajah di bawa menunjukkan atur cara yang tidak lengkap.

(MELAKA 2011)Dim Name as MDim Pi as NName = “ Taman Melati ”

[email protected] ( http://rmmict.blogspot.com )

Page 28: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

28

Pi = 3.142

Based on figure di atas, identify :/ Berdasarkan rajah di atas, kenal pasti :(i) M ……………………………….(ii) N ……………………………….

7. The followings are the combination of basic elements in programming with the examples. Choose the wrong combination. Berikut adalah gabungan elemen asas dalam pengaturcaraan berserta contoh. Pilih gabungan yang salah.

(SELANGOR 2011)

Basic Elements in Programming

Elemen Asas Pengaturcaraan

ExampleContoh

A VariablesPembolehubah

Age, miles, priceUmur, Jarak, Harga

B BooleanBoolean

True, FalseBenar, Palsu

C Logical operatorsOperator logic +, -, /, =

D IntegerInteger 1, 56, 1000

8. Figure 8 shows some samples of ciata.Rajah B menunjukkan beberapa sampel clota.

(SPM 2011)

Figure 8 / Rajah 8Based on Figure 8, identify: /Berdasarkan Rajah 8, kenal pasti:(i) integer / integer ………(ii) string / deretan ………

SECTION B

1. Figure 12(a) shows the input interface and Figure 12 (b) shows the output interface of a program.

[email protected] ( http://rmmict.blogspot.com )

Page 29: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

29

(SPM 2009)

Gambar 12 (a) menunjukkan antara muka input dan Gambar 12 (b) menunjukkan antara muka output dari sebuah program..Based on Figure l2(a) and Figure I2(b), / Berdasarkan Rajah 12(a) dan Rajah

I2(b),

(i) State the data type that should be used for both interface.Nyatakan jenis data yang patut digunakan untuk kedua-dua antara

muka.……………………………………

(ii) Give a reason for your answer. / Beri satu alasan bagi jawapan anda.………………………………………………………………………… …………………………………………………………………………

2. Figure 15 shows a user interface of a program used in Holborn Restaurant to calculate the yearly bonus for their employees. The employees who have been working for at least three years will be given a bonus of RM1 000.

Rajah I5 menunjukkan satu antara muka pengguna bagi satu atur cara yang digunakan oleh Restoran Holborn untuk mengira bonus tahunan bagi pekerjanya. Pekerja yang sudah bekerja sekurang-kurangnya tiga tahun akan diberikan bonus

RM1000. (SPM 2010)

[email protected] ( http://rmmict.blogspot.com )

Page 30: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

30

Figure 15 / Rajah 15Based on Figure 15: / Berdasarkan Rajah I5:State an appropriate data type for the variable 'Identity Card No. State one reason for yo'ur answer.Nyatakan satu jenis data yang sesuai bagi pemboleh ubah 'Identity Card No.Beri satu alasan anda.………………………………………………………………………… …………………………………………………………………………

3. Rajah 11 menunjukkan kod untuk satu aturcara mudah. (N.SEMBILAN 2011)

Figure 11 / Rajah 11

Based on Figure 11:/Berdasarkan Rajah 11 :(a) (ii) Identify data typeused in this program

Kenalpasti jenis data yang digunakan dalam aturcara ini……………………………………………………………………

SECTION C

1. The coding in table 12 is a segment of a Program to calculate Body Mass Index (BMI) and classify body weight. Aturcara pada jadual 12 adalah untuk mengira BMI dan mengklasifikasikan berat badan

(JOHOR 2011)

Based on the coding in table 12, Berdasarkan pada aturcara dalam jadual 12,

(a) What is the function of the bold words ?

Apakah fungsi perkataan

yang ditebalkan ? ……………………………………………….……………………………………………….……………………………………………….

[email protected] ( http://rmmict.blogspot.com )

Private Sub cmdCalc_Click() Dim Length, Width, Area As Single Dim msg As String Length = Val(txtLength.Text)

Width = Val(txtWidth.Text) Area = Length * Width msg = "The Area of The Rectangle is " lblArea.Caption = msg & Area

End Sub

Page 31: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

31

……………………………………………….5.1.5.3 Differentiate between mathematical and logical (Boolean) operators.

SECTION A

1. Figure 10 shows types of operator. Rajah I0 menunjukkan jenis-jeniso perator.

(SPM 2009)

Figure 10 / Rajah 10

Based on Figure 10, state two logical operators.Berdasarkan Rajah 10, nyatakan dua operator logik.………………………………………………. & ……………………………………………….

2. Figure 12 shows part of programming code Total Parking Charges.Rajah 12 menunjukkan sebahagian daripada kod atur cara Total Parking Charges.

(PULAU PINANG –HSBM 2011)

Figure 12 / Rajah 12

Based on 12 figure, state one Berdasarkan rajah 12, nyatakan satu :ii. Logical Operator /

Operator Logik:

[email protected] ( http://rmmict.blogspot.com )

Page 32: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

32

…………………………..

3. Which of the following is a logical operator?(SARAWAK 2011)

A +B >C ANDD EQUAL

4. Table 1 show types of operatorJadual 1 menunjukkan jenis operator

(PAHANG 2011)

Types Of OperatorJenis Operator

ItemItem

RPerform element by element comparisons between two arraysMelaksanakan elemen demi elemen perbandingan diantara dua jujukan.

SCompare two conditions and returns a true or false value.Membandingkan dua keadaan dan memulangkan nilai benar atau palsu.

Table 1 / Jadual 1Name the types of operator: / Namakanjenis operator:i. R ………………………………………..ii. S ………………………………………..

5. Figure below shows the types of operators used in Programming Language.Rajah di bawah menunjukkan jenis operator yang digunakan dalam Bahasa Pengaturcaraan.

(MELAKA 2011)a. Matematical operator / operator matematik

Examples / contoh = + , - , * , /b. Comparison operator / operator perhubungan

Examples / contoh => , < , = ,<>c. Y operator / operator Y

Examples / contoh =…………………..

(a) Name Y. / Namakan Y.……………………………….

(b) Give one example of Y / Beri satu contoh Y ……………………………….

6. Figure 7 shows some parts of a program code

[email protected] ( http://rmmict.blogspot.com )

Page 33: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

33

Rajah 7 menunjukkan sebahagian daripada kod pengaturcaraan.(SPM 2011)

Figure 7 / Rajah 7Based on Figure 7, identify: Berdasarkan Rajah 7, kenal pasti.logical operator / operator logic………

7. Table 2 shows the two types of operator along with the meaningJadual 2 menunjukkan 2 jenis operator beserta makna. (EXAM

2011)

What is the operator represented by Y?Apakah operator yang diwakili oleh Y ? Operator ……………………

SECTION B

1 Kassim is requested to develop a program to calculate the price of ticket in conjunction with the 15th anniversary of Terengganu Planetarium. Here is the pseudo code:

Kassim diminta membangunkan aturcara yang dapat mengira harga tiket sempena dengan sambutan ulangtahun ke-15 Planetarium Terengganu. Kod pseudo adalah seperti berikut:

(TERENGGANU 2011)[email protected] ( http://rmmict.blogspot.com )

Const disc= 0.8Const n = 500Dim unit as IntegerDim Price as DoubleDim amt as DoubleIf x > 5 Or rice > n Then amt = price * disc * unitElse

amt= price * unitEnd if

X Operator / Operator X

Meaning / Makna

+ Plus / Tambah

- Minus / Tolak

* Multiply / Darab

/ Devide / Bahagi

Y Operator / Operator Y

Meaning / Makna

And And Operator /

Operator Dan

Or Or Operator /

Operator Atau

Not Not Operator / Operator Tidak

Page 34: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

34

Figure 7 / Rajah 7 (a) State two types of operators used in the program in Figure 7.

Nyatakan 2 jenis operator yang digunakan dalam aturcara dalam Rajah 7. …………………………………………… & …………………………………………….

[2 marks] (b) State the difference between the operators in answer (a).

Terangkan perbezaan di antara operator dalam jawapan (a).

OperatorFunction /fungsi

Symbol / simmbol

[2 marks]SECTION C

1. The coding in table 12 is a segment of a Program to calculate Body Mass Index (BMI) and classify body weight. Aturcara pada jadual 12 adalah untuk mengira BMI dan mengklasifikasikan berat badan

[email protected] ( http://rmmict.blogspot.com )

Page 35: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

35

(JOHOR 2011)

Based on the coding in table

12, Berdasarkan pada aturcara dalam jadual 12, (c) Based on the coding in Table 12, state

Berdasarkan kepada aturcara dalam Jadual 12, nyatakan (i) mathematical operator / operator matematik

…………………………………………………..(ii) relational operator / operator relational

…………………………………………………. [ 2 markah ]

(d) Explain the function of the operators in (c). Jelaskan fungsi operator-operator dalam (c). …………………………………………………………………………………….…………………………………………………………………………………….…………………………………………………………………………………….

[ 2 markah ]

5.1.5.4 Differentiate between sequence control structure and selection control structure.

SECTION A

1. Figure 8(a) and 8(b) show flowchart segmentsRajah 8 (a) dan 8(b) menunjukkan segmen carta alir

(SPM 2007)[email protected] ( http://rmmict.blogspot.com )

Page 36: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

36

Figure 8(a) Figure 8(b)Identify the control structure used in kenalpasti struktur kawalan yang digunakan pada;i) Figure 8(a) : ________________________________________ii) Figure 8(b) : ________________________________________

2. State true or false / Nyatakan benar atau pasuA programmer uses flowcharts to code a program (T/F)

Pengaturcara menggunakan carta alir untuk mengekod aturcara(SPM 2007)

………………………..3 Which of the following symbols represents a decision in a selection control

structure? Antara yang berikut simbol yang manakah mewakili keputusan dalam struktur kawalan pilihan?

(SPM 2009)

4. Figure 10(a) and 10(b) shows partial flowcharts of two programs.

Rajah 10(a) dan IA(b) menunjukkan sebahagian carta alir untuk dua program.

[email protected] ( http://rmmict.blogspot.com )

Page 37: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

37

(SPM 2010)

Figurel0(a) / Rajah 10(a)Identify the control structure used in: / Kenal pasti struktur kawalan yang digunakan dalam:(i) Figure 10(a) / Rajah 10(a) ……………………………………………………(ii) Figure 10(b) / Rajah 10(b)……………………………………………………

5. Figure 5 shows an algorithm to calculate the total of x and y.Rajah 5 menunjukkan algoritma untuk mengira jumlah x dan y.

(PERAK 2011)

Figure 5 /Rajah 5Based on Figure 1, / Berdasarkan Rajah 1,

State the control structure used. / Nyatakan struktur kawalan yang digunakan……………………………….

6. Table 2 show the criteria of control structure.Jadual 2 menunjukkankriteriastrukturkawalan.

(PAHANG 2011)

X Executes statement one by one in linear or consercutive order.Melaksanakan pernyataansatu demi satu secara linear atau mengikut turutan.

Y Execute different statements for different [email protected] ( http://rmmict.blogspot.com )

BEGIN1. Read X and read Y2. Total = X+Y3. Print TotalEND

Page 38: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

38

Melaksanakan pernyataan berbeza bagi keadaan berbeza. Table 2

Jadual 2Based on Table 2, name of the control structure:Merujuk Rajah 2, namakanstrukturkawalan:a. X ……………………..;b. Y ……………………..

7. Complete the following statement:Lengkapkan pernyataan berikut:

(KEDAH 2011)In programming, a ……………. control structure consists of series of statement in which there are no branching, decision-making, or looping.Dalam pengaturcaraan, struktur kawalan .......................... terdiri daripada siri pernyataan yang tidak mempunyai cabang, pembuat keputusan, atau ulangan.

SECTION B

1. Figure 15 shows a user interface of a program used in Holborn Restaurant to calculate the yearly bonus for their employees. The employees who have been working for at least three years will be given a bonus of RM1 000. Rajah I5 menunjukkan satu antara muka pengguna bagi satu atur cara yang digunakan oleh Restoran Holborn untuk mengira bonus tahunan bagi pekerjanya. Pekerja yang sudah bekerja sekurang-kurangnya tiga tahun akan diberikan bonus RM1000. (SPM 2010)

Figure 15 / Rajah 15

Based on Figure 15: / Berdasarkan Rajah

I5:[email protected] ( http://rmmict.blogspot.com )

Page 39: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

39

State an appropriate data type for the variable 'Identity Card No.'.Identify the control structure used in the program.Kenal pasti struktur kawalanyang digunakan dalam atur cira ini.Justify your answer./Berikan justifikasi anda.……………………………………………….………………………………………………………………………………………………………………………………………………………………………………………………

2. Figure 17 shows the flow charts of program P and program Q.Rajah 17 menunjukkan carta aliran P program dan program Q.

(SARAWAK 2011)

Figure 17 / Rajah 17

[email protected] ( http://rmmict.blogspot.com )

Page 40: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

40

Based on Figure 17, /Berdasarkan Rajah 17(a) write output for P and Q when the input is 10 for both programs

tulis output P dan Q apabila input program bagi kedua-dua adalah 10P=...................... Q=...................... [2marks]

(b) explain the control structure used in program Q terangkan struktur kawalan yang digunakan dalam program Q...................................................................................................................

.................................................................................................................................

.................................................................................................................................

..............[2marks]

3. Figure 11 shows examples of program written in different control structures.Rajah 11 menunjukkan contoh aturcara yang ditulis dalam struktur kawalan yang berbeza.

(WILAYAH 2011)

Based on Figure 11 / Berdasarkan Rajah 11

[email protected] ( http://rmmict.blogspot.com )

Figure 11

Rajah 11

BA

Page 41: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

41

a. State the control structures used in A and B. Nyatakan struktur kawalan yang digunakan bagi A dan B.

A ……………………………………………..B ……………………………………………..

b. Explain the differences between these two control structures. Terangkan perbezaan di antara kedua-dua struktur kawalan ini.

.....................................................................................................................

.....................................................................................................................

.....................................................................................................................

.....................................................................................................................

SECTION C

1. The coding in table 12 is a segment of a Program to calculate Body Mass Index (BMI) and classify body weight. Aturcara pada jadual 12 adalah untuk mengira BMI dan mengklasifikasikan berat badan

(JOHOR 2011)

[email protected] ( http://rmmict.blogspot.com )

Page 42: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

42

Based on the coding in table 12, Berdasarkan pada aturcara dalam jadual 12, (b) (i) State the control structure used

Namakan struktur kawalan yang digunakan ………………………………………………….

(ii) Give one reason for the answer in (b)(i) . Berikan satu alasan bagi jawapan dalam (b)(i). ………………………………………………………………………………….………………………………………………………………………………….…………………………………………..

[ 2 marks ]

5.2 Program Development5.2.1 Program Development Phases5.2.1.1 Describe the five main phases in program development:• problem analysis • program design • coding • testing and debugging • documentation

SECTION A

1. Figure 9 show program development phaseRajah 9 menunjukkan fasa pembangunan aturcara

(SPM 2007)

Phase 2 and Phase 4 for the proper program development phase are :Fasa 2 dan 4 adalah;

[email protected] ( http://rmmict.blogspot.com )

1 Problem analysis

2

3 Coding

4

5 Documentation

Page 43: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

43

i) Phase 2 : …………………………………………………………………

ii) Phase 4 : ………………………………………………………………….

2. State the first phase and third phase of program development (SPM 2008)

I. First phase …………………………………….. II. Third phase ……………………………………..

3. Table 6 shows some activities carried out during the program development phases.Jadual 6 menunjukkan beberapa aktiviti yang dijalankan semasa fasa pembangunan program.

(SARAWAK 2011)Activity Phase

i. write program objective identify input, process and output meet users

• menulis objektif program• mengenal pasti input, proses dan output• memenuhi pengguna

A Problem analysisB Program designC CodingD Documentation

ii. draw flowchart create user interface• melukis carta aliran• mencipta antara muka pengguna

A analisis MasalahB Program reka bentukC CodingD Dokumentasi

Table 6Based on Table 6, write A, B, C or D to match the activities with the appropriate phase.Berdasarkan Jadual 6, tulis A, B, C atau D bagi memadan dengan aktiviti-aktiviti dengan fasa yang sesuai.i. .............................ii. .............................

4. The following are activities carried out during program development. Berikut merupakan aktiviti-aktiviti yang dijalankan semasa pembangunan atur cara

(PERAK 2011)[email protected] ( http://rmmict.blogspot.com )

Page 44: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

44

Arrange the above activities in the correct order.Susun antiviti-aktiviti tersebut mengikut turutan yang betul.………….., …………. , …………., …………..I

5. Table 9 shows the phases of program development. Jadual 9 menunjukkan fasa-fasa dalam pembangunan aturcara.

(TERENGGANU 2011)

Table 9 / Jadual 9 Based on Table 9, name / Berdasarkan Jadual 9, namakan (i) A ……………………………………..(ii) B ……………………………………..

6. Design phase refers to Fasa reka bentuk merujuk kepada

(TERENGGANU 2011)

A the system developers have to define problems, analyse the needs of target users and set the focus of the system. pembina sistem perlu mentakrifkan masalah, menganalisis keperluan pengguna dan menetapkan fokus sistem.

B the planning of the design in the system to be developed. perancangan reka bentuk sistem yang ingin dibangunkan.

C the system developers will convert the technical plan and design plan into a computer program. pembangun sistem akan menterjemah pelan teknikal dan reka bentuk menjadi satu aturcara komputer.

[email protected] ( http://rmmict.blogspot.com )

I Code the program using a programming languageMengekod atucara menggunakan bahasa pengaaturcaraan

II Meets users to understand the purpose and the requirementsBertemu pengguna bagi memahami tujuan dan keperluan

III Test the program and make sure it is error freeUji proram dan memastikan bebas daripada ralat

IVPrepare a flowchart or pseudocode to solve the problemMenyediakan carta alir atau psudocode untuk menyelesaikan masalah

Page 45: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

45

D the written material generated throughout all the phases of system development. bahan bertulis yang dihasilkan pada setiap fasa pembangunan sistem.

7. Figure 7 shows a simple program built by Usman.Rajah 7 menunjukkan satu aturcara mudah yang dibangunkan oleh Usman.

(N.SEMBILAN 2011)

Figure 7 / Rajah 7Based on Figure 7, state type of error occur when Usman execute this program.Berdasarkan Rajah 7, nyatakan Jenis Ralat yang berlaku apabila Usman melaksanakan aturcara ini.………………………………….

8. State whether the following statements is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.

(SELANGOR 2011)

The process of locating and correcting of syntax and logic errors in a program is known as debugging the program. Proses mencari dan membetulkan sintaks dan logik kesilapan dalam aturcara dikenali sebagai nyahpijat program.

[email protected] ( http://rmmict.blogspot.com )

Page 46: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

46

……………….

9. Figure 11 shows an interface of software. Rajah 11 menunjukkan antara muka bagi satu perisian.

(PERLIS 2011)

Figure 11 / Rajah 11

State the phase where the programmer uses this software to develop a program. Namakan fasa di mana pengaturcara akan menggunakan perisian ini untuk membangunkan sistem.…………………………………….

10. The following statement refers to one phase of program development. Pernyataan berikut merujuk kepada satu fasa dalam pembangunan aturcara.

(PERLIS 2011)

State the name of the phase. / Nyatakan nama fasa itu.

[email protected] ( http://rmmict.blogspot.com )

Page 47: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

PROGRAM MENGIRA 2 NOMBOR

NO. 1

NO. 2

HASIL TAMBAH : 44

2

P Q

20

47

………………………………………………………..

11. Figure 8 show type of error during programming development. Rajah 8 menunjukkan jenis ralat dalam pembangunan pengaturcaraan.

(PAHANG 2011)

Figure 8 / Rajah 8Based on the figure 8, identify the type of error:Berpandukan kepada rajah 8, nyatakan jenis ralat.a. P ………………………………..b. Q ………………………………..

12. The system developer will act as a quality controller during the ………………. phase, to ensure the database is executed correctly and error free.Pembangun sistem akan berperanan sebagai pengawal kualiti semasa fasa ……………… bagi memastikan pangkalan data dilaksanakan dengan betul dan tiada ralat. (KEDAH 2011)

13. Which of the following process take place in the program design phase.Antara proses berikut yang manakah berlaku dalam fasa reka bentuk atur cara?

(SPM 2011)I Preparing the user manual

M enyediakan manual penggunaII Writing pseudo code

Menulis [email protected] ( http://rmmict.blogspot.com )

Page 48: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

48

III Drawing flowchartsMelukis corta alir

IV Collecting dataMengumpul data

A land ll / dan II B Iand lV / I dan IVC II and III / II dan III D III and IV / III dan IV

14. Table 2 shows tasks carried out during a program development cycle. (SPM 2008)

Jadual 2 menunjukkan tugas dilakukan selama kitaran program pembangunan.P Write program / Menulis programQ Draw user interface / lukis antara muka penggunaR Indentify input and output / mengenalpasti input dan outputS Produce the user guide / Menghasilkan buku manualT Check for errors / Semak kesalahan

Based on Table 2, select P, Q, R, S and T for the following phases of the program development cycle :Berdasarkan jadual 2, pilih P,Q,R,S dan T bagi merujuk kepaaa fasa dalam kitaran pembangunan aturcarai. Problem analysis ……. ii. Documentation …….

SECTION B

1. Figure 15 shows the five phases involved in program development. Based on the figure, answer the following questions.Rajah l5 menunjukkan 5 fasa pembangunan aturcara. Berdasarkan gambarajah jawab soalan berikut

(KELANTAN 2011)

Figure 15 I Rajah l5

a) Name and describe phase X./Nama dan terangkan fasa X

………………………………………………………………………………………………..………………………………………………………………………………………………..

[email protected] ( http://rmmict.blogspot.com )

Page 49: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

49

………………………………………………………………………………………………..………………………………………………………………………………………………..

[2 marks]b) State 2 tools that are popular in generating a programme.

Nyatakan 2 alatan yang popular dalam menghasilkan sesebuah program.i. ………………………………………………………………………..ii. ………………………………………………………………………..

[2 marks]2. Rajah 11 menunjukkan kod untuk satu aturcara mudah.

(N.SEMBILAN 2011)

Figure 11 / Rajah 11

Based on Figure 11:/Berdasarkan Rajah 11 :(b) There are three types of error can occurred during testing and

debugging program. List TWO types of error.Terdapat tiga jenis ralat yang boleh muncul semasa pengujian dan menyahpijat aturcara dilakukan. Senaraikan DUA jenis ralat tersebut.i. …………………………………….ii. ……………………………………. [2

markah]

3. Figure 1 shows the five main phases in program development.Rajah 1 menunjukkan lima fasa dalam pembangunan aturcara. (PERAK

2011)

[email protected] ( http://rmmict.blogspot.com )

Private Sub cmdCalc_Click() Dim Length, Width, Area As Single Dim msg As String Length = Val(txtLength.Text)

Width = Val(txtWidth.Text) Area = Length * Width msg = "The Area of The Rectangle is " lblArea.Caption = msg & Area

End Sub

Phase M:Identify problemIdentify inputIdentify output

Phase : Documentation Documentation

Phase N: Private Sub cmdDisplay_Click()

If Val(txtchange.text)>=100 thenlblOutput.Caption=”Your change:” & _

Int (txtchange.text/100) & “Ringgit”

ElselblOutput.Caption=”Your change:” & _

txtchange.text & “cents”End if

End Sub

Phase : Program design Phase : Testing and debugging

Page 50: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

50

FIGURE 1/RAJAH 1a. Name the phases : / Namakan fasa-fasa : [2

marks]M : ……………………………………N : ……………………………………

b. Explain two activities involved in documentation phase]Jelaskan dua aktiviti yang terlibat dalam fasa dokumentasi.

[2 marks]………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………

SECTION C

1. Figure 17 shows the phases of Program Development process. Based on the figure, answer the following questions:Rajah 17 menunjukkan fasa-fasa proses Pembangunan Aturcara. Berdasarkan rajahtersebut, jawab soalan-soalan berikut:

(PULAU PINANG –HSBM 2011)

[email protected] ( http://rmmict.blogspot.com )

Page 51: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

51

Figure 17 / Rajah 17.

a) Name Phase P and Phase Q and explain the importance for each phases Namakan Fasa P dan Q dan terangkan kepentingan setiap fasa.(P)……………………………………………………………………………………………………………………………………………………..………………………………………………………………………………………………..………………………………………………………………………………………………..………………………………………………………………………………………………..………………………………………………………………………………………………..

(Q)……………………………………………………………………………………………………………………………………………………..………………………………………………………………………………………………..………………………………………………………………………………………………..………………………………………………………………………………………………..………………………………………………………………………………………………..

[ 4 marks ]b) i. Give two consequences if Activity X for Problem Analysis Phase

is omitted. Berikan dua akibat sekiranya Aktiviti X dalam Fasa Analisis Masalah tidak dilakukan.

[email protected] ( http://rmmict.blogspot.com )

Page 52: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

52

……………………………………………………………………………………….……………………………………………………………………………………….……………………………………………………………………………………….

[2 marks]ii. Arrange all the phases in correct order.

Susun kesemua fasa menglkut aturan yang betul.……………………………………….……………………………………….……………………………………….……………………………………….……………………………………….

[ 1 mark ]

5.2.2 Develop a program5.2.2.1 Apply program development phases to solve problems.

SECTION A

1. Rajah 11 menunjukkan kod untuk satu aturcara mudah.(N.SEMBILAN 2011)

Figure 11 / Rajah 11Based on Figure 11:/Berdasarkan Rajah 11 :(a) (i) If user key in 5 for Length and 4 for Width, write the output that will generate when user execute the program.

Jika pengguna memasukkan 5 untuk “Length” dan 4 untuk “Width”, tulis output yang terhasil apabila aturcara dilaksanakan……………………..

2. Figure 10 shows a pseudo code for a program.

[email protected] ( http://rmmict.blogspot.com )

Private Sub cmdCalc_Click() Dim Length, Width, Area As Single Dim msg As String Length = Val(txtLength.Text)

Width = Val(txtWidth.Text) Area = Length * Width msg = "The Area of The Rectangle is " lblArea.Caption = msg & Area

End Sub

Page 53: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

53

Rajah 10 menunjukkan kod pseudo bagi satu program.(PERLIS 2011)

Figure 10 / Rajah 10 Based on Figure 10, identify: Berdasarkan Rajah 10, kenalpasti; (i) input

……………… (ii) process

………………

SECTION C

1. Table 4 shows text and grading range for all subjects in Sekolah Menengah Kebangsaan Pelita.Jadual 4 menunjukkan teks dan julat gred bagi semua mata pelajaran di SMK

Pelita.(SPM 2010)

[email protected] ( http://rmmict.blogspot.com )

Page 54: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

54

Based on the text: / Berdasarkan teks itu:(a) State four activities which will be performed by Ahmad in program

analysis.Nyatakan empat aktiviti yang akan dilakukan oleh Ahmad dalam menganalisis program.…………………………………………………………………………….…………………………………………………………………………….…………………………………………………………………………….…………………………………………………………………………….

(b) Ravi tested the system and entered the mark 69 and,the output is grade D.

Ravi menguji sistem dengan memasukkan markah 69 dan outputnya menunjukkan gred D.(i) What type of error is this? / Apakah jenis ralat ini?

………………………….(ii) Justify your answer. / Berikan justifikasi anda.

……………………………………………………………………… ………………………………………………………………………………………………………………………………………………………………………………………………………………………

2. As an ICT student, Azizah is asked to develop a program to calculate the volume of water to be filled in an aquarium. The aquariums length is 120 cm and the width is 50 cm. The user will key in the height or level of water to be filled in the aquarium. Maximum level of water is 60 cm. The program will calculate and display the volume of water needed based on the water level entered by user.Sebagai pelajar ICT, Azizah diminta membangunkan aturcara yang dapat mengira isipadu air yang perlu diisi ke dalam akuarium. Diberi panjang dan lebar akuarium ialah 120 cm dan 50 cm. Pengguna perlu memasukkan ketinggian atau aras air yang akan diisi kedalam akuarium. Aras air maksimum ialah 60 cm. Aturcara ini akan mengira dan memaparkan isipadu air yang diperlukan berdasarkan ketinggian air yang dimasukkan oleh pengguna

(N.SEMBILAN 2011)

b. i) Write a formula to calculate the volume of water. Tulis formula untuk mengira isipadau air.

.......................................................................................................sppangsess@gmail.com ( http://rmmict.blogspot.com )

Page 55: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

55

ii) Draw a user interface design for output.Lukis rekabentuk antaramuka pengguna bagi output.

(4m)3. Figure 11 shows goods on sale in a shop.

Rajah 11 menunjukkan barang-barang jualan murah di sebuah kedai. (SELANGOR 2011)

Figure 11 / Rajah 11

Based on Figure 11, you are asked to develop a program to calculate the final price of each item.Berdasarkan Rajah 11, anda dikehendaki membina satu program untuk menghitung harga muktamad setiap barang.

(b) Write the pseudo code for the program. Tulis kod pseudo untuk program itu.

[email protected] ( http://rmmict.blogspot.com )

25% Discount

Page 56: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

56

[4 marks]4. Figure 16 shows a holiday package in a web site.

Rajah 16 menunjukkan pakej percutian dalam satu laman web.(PERLIS 2011)

Figure 16 / Rajah 16

Based on Figure 16, you are asked to develop a program to calculate the final package price of each destination. Berdasarkan Rajah 16, anda dikehendaki membina satu program untuk mengira harga akhir bagi setiap pakej destinasi.

(b) Write a pseudo code OR a flow chart for the program. Tulis kod pseudo ATAU carta alir untuk program tersebut.

[4 markah]

5. Figure 14 shows a user interface of a program used to calculate a total of two numbers.Rajah 14 menunjukkan antaramuka pengguna satu program yang mengira jumlah dua nombor.

(PAHANG 2011)

[email protected] ( http://rmmict.blogspot.com )

PROGRAM TO ADD TWO NUMBER

Number 1

Page 57: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

57

Figure 14 / Rajah 14

Based on Figure 14: / Berdasarkan Rajah 14:

(i) Write a pseudo codeTuliskankod pseudo

[3 markah](ii) Draw a flow chart.

Lukiskan carta alir.

[email protected] ( http://rmmict.blogspot.com )

Number 2

CALCULATE

Page 58: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

58

[4 markah]

6. Figure below shows development of a program. Rajah di bawah menunjukkan pembangunan satu program.

(MELAKA 2011)

Based on the case study and pseudo code at figure above : Berdasarkan kajian kes dan kod pseudo pada rajah di atas :a) Identify the input, process and output of the program.

Kenalpasti input, proses dan output program . Input : ……………………………………………………………………………Proses : ……………………………………………………………………………

…………………………………………………………………………… Output: ……………………………………………………………………………

…………………………………………………………………………… [3 marks]

b) Based on the pseudo code given, draw a complete flow chart of the program. Berdasarkan kod pseudo yang diberi, lukiskan carta alir bagi program berkenaan.

[4 marks]

[email protected] ( http://rmmict.blogspot.com )

Pseudo CodeBEGINKey in students’ data (verify data)

If all fields filled thenPrint Curriculum Unit

ElsePrint Error Message

End ifEND

Case StudyYour school needs a registration program to computerize the registration of Curriculum Unit. All students in the school should have his/her data like name, class and IC number keyed into the Curriculum Unit Registration Program. After the program verifies the student data and all fields are filled, it will notified his/her Curriculum Unit for the coming academic year.

Page 59: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

59

7. Figure 7 below shows a portion of a Visual Basic coding to calculate the area of rectangle.Rajah 7 menunjukkan sebahagian kod pengaturcaraan Visual Basic pengiraan luas segiempat.

(WILAYAH 2011)

Figure 7/Rajah 7Based on figure 7, / Berdasarkan rajah 7,

ii. Complete the flow chart below Lengkapkan carta alir di bawah.

A : ...................................................B : ...................................................

[email protected] ( http://rmmict.blogspot.com )

Private Sub Command1_Click()Dim Length, Height, Area As DoubleLength = Val (txtLength.Text)Height = Val (txtHeight.Text)Area = Length * WidthlblArea = ‘The Area of Rectangle is ‘ & AreaEnd Sub

Begin

End

A

Area of Rectangle=

Length * Width

B

Page 60: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

60

8. Figure 19 shows part of the program code to find the area of a rectangle.Rajah 19 menunjukkan sebahagian daripada kod program untuk mencari kawasan segi empat tepat.

(SARAWAK 2011)

Figure 19 /Rajah 19Based on Figure 19,Berdasarkan Rajah 19,(a) draw the flowchart for the program

lukis carta aliran untuk program

[5 marks]

[email protected] ( http://rmmict.blogspot.com )

Page 61: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

61

(b) copy and complete the Table 8 salin dan lengkapkan Jadual 8

[2 markah]9 Figure 13 shows an advertisement placed by QS Brick Sdn. Bhd. You are

required to develop a program to caiculate the total charges per order.Rajah l3 menunjukkan iklan yang clikeluarkan oleh QS Brick Scln.'Bhcl. Andadikehendaki membangunkan aturcara untuk mengira jumlah bayaran bagisetiap tempahan.

(SPM 2011)

Figure 13 / Rajah l3Based on Figure 13:Berdasarkan Rajah l3:(a) (i) Identify the input and output of the program.

Kenal pasti input dan output bagi atur cara itu.Input : ……………………………………..Output: ……………………………………..

(ii) Write the formula used for the program.Tuliskan formula yang digunakan untuk atur cara itu.…………………………………………………………………………….

(4 marks)

(b) Sketch a design of the input interface for the program.Lakarkan reka bentuk antara muka input bagi atur cara itu.

[email protected] ( http://rmmict.blogspot.com )

Page 62: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

62

(3 marks)

10. Figure 6 shows a portion of a programming codeRajah 6 menunjukkan sebahagian kod pengaturcaraan.

(PERAK 2011)

Figure 6 / Rajah 6

Draw the suitable shapes in flowchart for “X” Lakarkan bentuk yang sesuai di dalam carta alir bagi “X”

5.3 Current and Future Developments5.3.1 Latest Programming Languages5.3.1.1 Find out the latest programming languages:• fifth generation language • natural language • OpenGL (Graphic Library)

[email protected] ( http://rmmict.blogspot.com )

X

Page 63: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

63

SECTION A

1. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.

(N.SEMBILAN 2011)(ii) Natural language is known as a low-level programming language. Bahasa Tabii juga dikenali sebagai bahasa pengaturcaraan aras rendah.

…………………………………….

SEMAKAN

Tarikh Topik / Subtopik Tanda Tangan Guru

Catatan

5.1 Basic Programming Concepts5.1.1 Define Program and Programming

[email protected] ( http://rmmict.blogspot.com )

Page 64: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

64

Language5.1.1.1 State the definition of program.5.1.1.2 State the definition of programming language.

5.1.2 Levels and Generations Of Programming Languages5.1.2.1 Identify the generations of low-level programming languages with examples.5.1.2.2 Identify the generations of high-level programming languages with examples.

5.1.3 Programming Language Approaches5.1.3.1 Define structured approach in programming.5.1.3.2 Define object-oriented approach in programming.5.1.3.3 Differentiate between structured approach and object-oriented approach in programming.

5.1.4 Translator5.1.4.1 Describe the translation method of programming using assembler, interpreter and compiler.

5.1.5 Basic Elements In Programming5.1.5.1 Differentiate between constants and variables.5.1.5.2 Differentiate between the data types: Boolean,integer, double, string and date.5.1.5.3 Differentiate between mathematical and logical (Boolean) operators.5.1.5.4 Differentiate between sequence control structure and selection control structure.

Tarikh Topik / Subtopik Tanda Tangan Guru

Catatan

5.2 Program Development5.2.1 Program Development Phases

[email protected] ( http://rmmict.blogspot.com )

Page 65: rmmict.files.wordpress.com · Web view(SPM 2008) 2. Write the word that would complete the following statement: Tulis perkataan yang akan melengkapkan penyata berikut: (SARAWAK 2011)

65

5.2.1.1 Describe the five main phases in program development:• problem analysis • program design • coding • testing and debugging • documentation5.2.2 Develop a program5.2.2.1 Apply program development phases to solve problems.

5.3 Current and Future Developments5.3.1 Latest Programming Languages5.3.1.1 Find out the latest programming languages:• fifth generation language • natural language• OpenGL (Graphic Library)

.

[email protected] ( http://rmmict.blogspot.com )