1 - rmm ict group | sekadar luahan rasa web view · 2011-01-20program pembayaran gaji....
TRANSCRIPT
5.1.1.1 State the definition of program.
Section A
1. State True or False for the following statement.Nyatakan Benar atau Palsu pada pernyataan berikut.
Programming is a series of organized instructions that directs a computer to perform task.Pengaturcaraan ialah satu siri arahan yang mengarahkan komputer untuk melaksanakan tugas. F
Source Year
Level
Bloom
SELANGOR 2010
2. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.A program is a series of instructions that directs a computer to perform tasks.Program ialah satu siri arahan yang boleh dicapai terus oleh komputer untukmelaksanakan tugas. TRUE / BENAR
Source Year
Level
Bloom
TERENGGANU 2010
14. The process of writing instructions or code for computers is known as _______________.
Proses menulis kod atau arahan-arahan dikenali sebagai ______________.
Source Year Level
Bloom
UNKNOWN
2008
5. Computer____________________is a set of commands or instructions which directs a computer in doing a task.
Komputer _________________________adalah set arahan atau suruhan yang mengarahkan komputer melakukan suatu tugasan.
A. Program Aturcara
B. Programming Pengaturcaraan
C. Programmer Pengaturcara
D. Programming Language Bahasa Pengaturcaraan
1
Source Year Level
Bloom
UNKNOWN
2008
Source Year Level
Bloom
TERENGGANU 2009
Section B
Section C
5.1.1.2 State the definition of programming language.
Section A
1. 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. F
Source Year
Level
Bloom
SPM 2010
18.
X
A set of words, symbols and codes that enables humans to communicate with computers.Satu set perkataan,simbol dan kod yang membolehkan pengguna berkomunikasi dengan komputer.
Y
Is a series of organised instruction that directs a computer to perform tasks.Satu siri arahan yang tersusun yang mengarahkan komputer untuk melaksanakan tugas.
Table 2 Jadual 2
Based on Table 2, match the statement by writing X or Y.
Berdasarkan Jadual 2, suaikan penyataan yang diberikan dengan menulis samada X atau Y.
i. It contains a list of variables and a list of statements that tell the computer what to do with the variables.Ia mengandungi satu senarai pembolehubah dan satu senarai penyataan yang memberitahu komputer apa yang perlu dilakukan dengan pembolehubah.
ii. It is uses for writing computer programs, that direct a computer to perform computation and to organise the flow of control between mechanical devices.
2
Ia digunakan untuk menulis program komputer yang mengarahkan komputer untuk melaksanakan pengiraan dan menguruskan aliran kawalan antara perkakasan mekanikal.
Source Year
Level
Bloom
PERAK 2008
6. State whether the following statement is True or False
Nyatakan sama ada pernyataan berikut Benar atau Palsu
A programming language is a set of words, symbols and codes that enables humans to communicate with computers.
Bahasa pengaturcaraan adalah satu set huruf, simbol dan kod yang membolehkan manusia berkomunikasi dengan komputer.
Source Year Level
Bloom
UNKNOWN
2009
24. A programming language is a set of words, symbols and _______ that enables humans to communicate with computers.Bahasa pengaturcaraan adalah satu set perkataan, simbol dan _________ yang membolehkan manusia berkomunikasi dengan komputer.
Source Year Level
Bloom
UNKNOWN
2009
17 A set of words, symbols and codes that enables human to communicate with computers is known as _________________________ .
Source Year Level BloomSARAWAK (A) 2009
12. Programming language is a set of words, ________________ and ______________ that enables
humans to communicate with computers.
Bahasa pengaturcaraan adalah merupakan satu set perkataan, _______________ dan _________________ yang membolehkan manusia berkomunikasi dengan komputer.
Source Year
Level
Bloom
N. SEMBILAN
2009
19. Complete the following statements by filling in the blanks.
Isikan ruang kosong untuk melengkapkan pernyataan berikut:
i] Programming language will be ______________ so that it can be executed by a computer or
electronic device.3
( i )
Bahasa pengaturcaraann akan ______________ supaya ia boleh dilaksanakan oleh komputer atau
peranti elektronik.
ii] Programming is a set of _____________ which directs a computer in doing a task.
Pengaturcaraan ialah satu set _____________ yang mengarahkan sesebuah komputer untuk
melaksanakan sesuatu tugasan.
Source Year Level
Bloom
PERLIS 2009
15. 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.Bahas pengaturcaraan adalah satu set peraturan yang boleh digunakan untuk memberitahu komputer tugasan yang perlu dilaksanakan.
Source Year Level
Bloom
SPM 2008
Section B
Section C
5.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.
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 second generation(ii) Y first generation,
Source Year
Level
Bloom
SPM 2010
2. The lowest level of programming language is / Bahasa pengaturcaraan aras terendah ialahA. BASIC / BASICB. Natural language / Bahasa TabiiC. Machine language / Bahasa MesinD. Assembly language / Bahasa PenghimpunC
4
Source Year
Level
Bloom
KELANTAN 2010
3. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut adalah Benar atau Palsu.i. Low-level programming language is a programming language that is more abstract, easier to use and
must translate into machine language before execution.i. Bahasa pengaturcaraan aras rendah adalah bahasa pengaturcaraan yang lebih abstrak, mudah
digunakan dan mesti diterjemahkan ke dalam bahasa mesin sebelum perlaksanaan.F
Source Year
Level
Bloom
PAHANG 2010
4. Assembly language is the human-readable notation for the machine language used tocontrol specific computer operations. This statement refers to high-level programminglanguages.Bahasa himpunan adalah bahasa mesin yang boleh difahami oleh manusia digunakanuntuk mengawal operasi komputer yang tertentu. Kenyataan ini merujuk kepada bahasapengaturcaraan paras tinggi. FALSE / PALSU
Source Year
Level
Bloom
TERENGGANU 2010
5. State whether the following statement is True or False. Nyatakan sama ada pernyataan berikut Benar atau Palsu. An assembly language programmer writes instructions using symbolic instruction codes. Pengaturcara bahasa penghimpun menulis arahan menggunakan kod arahan simbolik. True
Source Year
Level
Bloom
SPM 2010
16.
The statements above best describe ______________________________.
Source Year
Level
Bloom
PENANG 2008
5
It is the native language of any CPUs.
Program consists of a series of 0s and 1s.
Program can run faster because no translation is required.
15. Machine language is a set of ________________ and data that a computer central processsing unit can execute directly.Bahasa Mesin terdiri daripada set ________________ dan data yang membolehkan unit pemprosesan pusat memproses secara terus.
Source Year Level
Bloom
UNKNOWN
2008
6. Machine language is the ________________. Bahasa Mesin adalah __________________. A. Natural Language
Bahasa TabiiB Low-level programming language
Bahasa Pengaturcaraan Peringkat-RendahC. High-level programming language Bahasa Pengaturcaraan Peringkat-TinggiD. Very high-level programming language
Bahasa Pengaturcaraan Peringkat-TertinggiSource Year Lev
elBloom
UNKNOWN
2008
25 Machine language is the
Bahasa Mesin adalah
A. natural language bahasa Tabii
B. low-level programming language bahasa pengaturcaraan peringkat-rendah
C. high-level programming language bahasa pengaturcaraan peringkat-tinggi
D. very high-level programming language bahasa pengaturcaraan peringkat-tertinggi
Source Year Level
Bloom
UNKNOWN
2009
23. The instructions of programming language are written in mnemonic instruction codes. Arahan-arahan di dalambahasa pengaturcaraan ditulis menggunakan kod arahan mnemonik
A. Compiler Pengkompil
B. Assembly Penghimpun
C. Variable Pemboleh ubah
D. Intepreter Pentejemah
Source Year Level
Bloom
UNKNOWN
2009
6
21. Which of the following is Low-Level Programming Language?
Manakah antara berikut Bahasa Pengaturcaraan Aras Rendah?
A. Natural Language
Bahasa Tabie
B. Assembly Language
Bahasa Himpunan
C. Non-Procedural Language
Bahasa Bukan Prosedur
D. Procedural Language
Bahasa Prosedur
Source Year Level
Bloom
UNKNOWN
2009
18 State whether the following statements are True or False.
(i) An assembly language programmer writes instructions using symbolic instruction codes that are meaningful abbreviations or mnemonics.
(ii) A structured programming approach is a programming approach that break big problems into smaller problems, then further break those into still smaller problems, and so on, until a level of such simplicity is reached.
Source Year Level BloomSARAWAK (A) 2009
6. The following are examples of programming languages. Choose the correct pair.Berikut adalah contoh bahasa pengaturcaraan. Pilih pasangan yang betul.
GenerationsGenerasi
Programming LanguageBahasa Pengaturcaraan
A FirstPertama
SQL LanguageBahasa SQL
B SecondKedua
Assembly LanguageBahasa Penghimpunan
C ThirdKetiga
Machine LanguageBahasa Mesin
D FourthKeempat
C LanguageBahasa C
Source Year Level
Bloom
JOHOR 2009
13. Which of the following is a low-level programming language?
Manakah di antara yang berikut merupakan bahasa pengaturcaraan aras rendah?
A. Natural Language Bahasa Tabii
B. Assembly Language Bahasa Perhimpunan
7
C. Non-Procedural Language Bahasa Bukan ProsedurD. Procedural Language Bahasa Prosedur
Source Year
Level
Bloom
N. SEMBILAN
2009
19. Machine language is the Bahasa Mesin adalah
E. natural language Bahasa Tabii
F. low-level programming language Bahasa Pengaturcaraan Peringkat-Rendah
G. high-level programming languageBahasa Pengaturcaraan Peringkat-Tinggi
H. very high-level programming language Bahasa Pengaturcaraan Peringkat-Tertinggi
Source Year Level
Bloom
UNKNOWN
1. The followings are the combination of generation with the programming language type. Choose the wrong combination.
Berikut adalah gabungan generasi dengan jenis bahasa pengaturcaraan. Pilih gabungan yang salah.
Generation Generasi
Types Of Language Jenis Bahasa
A First GenerationGenerasi Pertama
Machine Language Bahasa Mesin
B Second Generation Generasi Kedua
Assembler Language Bahasa Penghimpun
C Third Generation Generasi Ketiga
Natural Language Bahasa Tabii
D Fourth Generation Generasi Keempat
Query Language Bahasa Pertanyaan
Source Year Level
Bloom
KELANTAN
2009
20. Which of the following programming language is categorized as low-level?
Yang manakah diantara bahasa pengaturcaraan berikut merupakan bahasa aras
rendah?
A. Assembly language Bahasa penghimpun
B. PASCAL PASCAL
C. Artificial Intelligent Kepintaran Buatan
D. FORTRAN FORTRAN8
Source Year Level
Bloom
PERLIS 2009
18. Assembly language is the ________ generation programming language.
Bahasa himpunan merupakan bahasa pengaturcaraan generasi ke _________
A. first pertama
B. third ketiga
C. fourth keempat
D. second kedua
Source Year Level
Bloom
PERLIS 2009
16. Complete the following statements by filling in the blanks.Isikan runag kosong untuk melengkapkan pernyataan berikut.
A ………(i)……… level programming language uses codes, …….(ii)…… and is machine dependent.
Bahasa pengaturcaraan aras ………(i)……… menggunakan kod, …….(ii)…… dan bergantung
kepada mesin.
Source Year Level
Bloom
SPM 2008
Section B
Section C
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 PalsuFifth Generation programming language is more abstract and easier to use.Bahasa pengaturcaraan generasi ke-5 lebih abstrak dan lebih mudah digunakan.TRUE / BENAR
Source Year Level
Bloom
TERENGGANU 2008
5. Which of the following programming languages are categorized as high-level?
I ASSEMBLY
II PASCAL
III SQL
IV PROLOG
A. I, II and III
B. I, II and IV
9
C. I, III and IV
D. II, III and IV
Source Year
Level
Bloom
PETALING PERDANA 2008
03 The most recent type of computer language would be ……Bahasa komputer yang terbaru adalah …..
A machine language bahasa mesin
B assembly languagebahasa himpunan
C third-generation languagebahasa generasi ketiga
D natural languagebahasa tabii
Source Year Level BloomSARAWAK
(A)2008
20 Table 3 shows a list of programming languages.
Match the correct answer for statement (a) and (b) from Table 3. Write P, Q, R or S.
P Q R S
3GL Assembly Language
5GL Machine Language
Table 3
(a) The source code is written in binary.
(b) The programming language that allows people to interact with computers without needing any specialised knowledge.
Source Year Level BloomSARAWAK
(A)2008
4. The _______________ programming language provides a visual or graphical interface for creating source-code.A. naturalB. low-levelC. high-levelD. very high-level
Source Year Level
Bloom
JOHOR 2008
10
7. Table 3 shows some terms used in Information and Communication Technology.
Jadual 3 menunjukkan sebahagian terma yang digunakan dalam teknologi maklumat dan komunikasi.
Fifth generation language Natural Language OpenGL (Graphics Library)
Choose the term shown in Table 3 that matches with the following statements:
Pilih terma yang ditunjukkan dalam jadual 3 yang sepadan dengan pernyataan berikut :
(i) A standard specification to describe the standard Application Programming Interface (API) for 3D/2D computer graphic applications.
Satu spesifikasi piawai untuk menghuraikan standard Application Programming Interface (API) bagi aplikasi grafik komputer 3D / 2D .
(ii) Mostly used in artificial intelligence research. For examples Prolog and Mercury.
Kebanyakannya digunakan dalam penyelidikan kecerdasan buatan. Contohnya Prolog dan Mercury.
Source Year Level
Bloom
UNKNOWN
2009
22. Fill in the blanks to complete the statement below.Isikan ruang kosong untuk melengkapkan pernyataan di bawah.
In the ……(i)……… generation of programming language, programs written must be translated into machine language by a …….(ii)……… or interpreter.
Dalam generasi ke ….(i)……. bahasa pengaturcaraan, program yang ditulis mesti diterjemahkan ke dalam bahasa mesin oleh ………(ii)…… atau pentafsir.
Source Year Level
Bloom
UNKNOWN
2009
11
Table 3 Jadual 3
Source Year Level
Bloom
TERENGGANU 2009
16. The following are some examples of programming languages.
I. SQLII. Machine CodeIII. COBOLIV. Symbolic Assembler
Rearrange all these programming languages according to their generations.
A. I, II, III,IV C. I, III, IV, IIB. II, IV, III, I D. II, III, IV, I
Source Year Level
Bloom
PCGHS 2009
15 Table 5 shows two types of programming languange.Jadual 5 menunjukkan dua jenis bahasa pengaturcaraan
X YIt uses a series of English-like words, just like human language.
Ia menggunakan siri perkataanseumpama Bahasa Inggeris yang hampir sama dengan bahasa manusia
It is known as natural language andprovides a visual on graphical interface for creating source codes.
Ia dikenali sebagai bahasa tabii danmenyediakan visual atau antaramuka grafikuntuk menghasilkan kod sumber.
Table 5 Jadual 5
12
Based on Table 5, name the Generation of Programming Language :Berdasarkan Jadual 5, namakan Generasi Bahasa Pengaturcaraan :
( i ) X : ……………………..( ii ) Y : ……………………..
16. Prolog and Mercury are the examples of the programming language which are also known as natural language.Prolog dan Mercury adalah contoh-contoh bahasa pengaturcaraan yang dikenali sebagai bahasa tabii.
i) Based on the above statement, identify the generation of the programming language.Berdasarkan pernyataan di atas, kenalpasti generasi bahasa pengaturcaraan tersebut.
PASCAL, C++, SQL and NOMAD are some examples of programming language that are in the same level.PASCAL, C++, SQL dan NOMAD adalah contoh-contoh bahasa pengaturcaraan yang berada di dalam aras yang sama.
ii) Based on the above examples, identify the level of the programming language.Berdasarkan pernyataan di atas, kenalpasti aras bahasa pengaturcaraan tersebut.
Source Year Level
Bloom
KEDAH 2009
18. Which of the following languages are categorized as high- level programming languages?
Yang manakah antara bahasa pengaturcaraan berikut dikategorikan sebagai bahasa pengaturcaraan
aras tinggi?
I. ASSEMBLY
II. PASCAL
III. SQL
IV. MERCURY
A. I, II and III
B. I, II and IV
C. I, III and IV
D. II, III and IV
Source Year Level BloomHULU LANGAT 2009
13. Table 2 shows a list of programming languages. Match the correct item with the statements below.
Jadual 2 menunjukkan senarai bahasa pengaturcaraan. Padankan item yang betul dengan pernyataan di
bawah
Item Programming Language
13
Bahasa Pengaturcaraan
P C++
Q Java R Prolog S Machine Language T Assembly Language
Table 2 Jadual 2
i) The source code is written in binary.
Kod sumber ditulis dalam binari.
ii) The programming language that is object-oriented.
Bahasa pengaturcaraan berasaskan objek.
iii) The programming language that makes computer thinks like human.
Bahasa pengaturcaraan yang membolehkan komputer berfikir seperti manusia.
Source Year Level BloomHULU LANGAT 2009
20 Programs written in a _____________ programming language must be translated into machine language by a compiler or interpreter. Program yang ditulis dalam ____________ bahasa pengaturcaraan mesti di terjemah ke dalam bahasa mesin oleh penyusun dan penterjemah
A. naturalB. low-levelC. high-levelD. very high-level
Source Year Level
Bloom
WPKL 2009
2. The followings are the combination of generation with the programming language type. Choose the wrong combination.
Berikut adalah gabungan generasi dengan jenis bahasa pengaturcaraan. Pilih gabungan yang salah.Generation Generasi
Types Of Language Jenis Bahasa
A First GenerationGenerasi Pertama
Machine Language Bahasa Mesin
B Second Generation Generasi Kedua
Assembler Language Bahasa Penghimpun
C Third Generation Generasi Ketiga
Natural Language Bahasa Tabii
14
D Fourth Generation Generasi Keempat
Query Language Bahasa Pertanyaan
Source Year Level
Bloom
KELANTAN
2009
18. Complete the following statements by filling in the blanks:Isikan ruang kosong untuk melengkapkan pernyataan berikut:
A ……………………………… level programming language is more easier to use and allows more people to interact with computers.
Bahasa pengaturcaraan aras ………………………………lebih mudah digunakan dan membolehkan ramai manusia berinteraksi dengan komputer.
Source Year Level
Bloom
PERAK 2009
17 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 mesh diterjemahkan ke dalam bahasa mesin sebelum dilaksanakan.
Source Year Level
Bloom
SPM 2009
Section B
Section C
5.1.3.1 Define structured approach in programming.
Section A
3. State whether the following statements is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.- Structured programming usually uses top down design model.
Pengaturcaraan berstruktur biasanya menggunakan model rekabentuk atas bawah.TRUE
Source Year
Level
Bloom
PERLIS 2010
1. Write the words that would complete the following statement: Tulis perkataan yang dapat melengkapkan pernyataan berikut: _________________ 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.
15
StructuredSource Yea
rLevel
Bloom
PUTRAJAYA 2010
Source Year Level
Bloom
TERENGGANU 2009
14. A computer programming technique in which the program is divided into modules like function, sub-
routine and procedure is defined as a ____________________.
Pendekatan pengaturcaraan komputer di mana atur cara dipecahkan kepada modul-modul seperti
fungsi, subrutin dan prosedur didefinisikan sebagai _____________________.
Source Year
Level
Bloom
N. SEMBILAN
2009
19. Which of the following characteristics are related to a structured programming approach?Antara ciri-ciri berikut yang manakah berkaitan dengan pendekatan pengaturcaraan berstruktur?
I. The object have a relationship between one another.Objek mempunyai hubungan dengan setiap yang lain.
II. A program may have a module or several modules.Aturcara mempunyai modul atau sebilangan modul.
III. A program often uses the top-down design model.Aturcara selalunya menggunakan model rekabentuk atas-bawah.
IV. The program languages is event-driven.Bahasa pengaturcara adalah pacuan peristiwa.
A. I and II I dan IIB. I and III I dan IIIC. II and III II dan IIID. II and IV II dan IV
Source Year Level
Bloom
PERAK 2009
2. State one approach in programming.Nyatakan satu pendekatan dalam pemgaturcaraan.
Source Year Lev Bloom16
elSPM 2007
Section B
Section C
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.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 IVD
Source Year
Level
Bloom
SPM 2010
2. Table 6 shows statements about programming approaches.Jadual 6 menunjukkan pernyataan mengenai pendekatan pengaturcaraan.
XThis approach uses top-down design model. Complex problems are dividedinto a hierarchy of smaller and more manageable program modules.Pendekatan ini menggunakan model rekabentuk atas-bawah. Masalah yangkompleks dipecahkan kepada modul yang lebih kecil dan lebih terurus secaraberhirarki.YA programming approach that consists of objects that combines data and functionPendekatan pengaturcaraan yang terdiri daripada objek-objek yang menggabungkan data dan fungsi.
Table 6 / Jadual 6
Based on Table 6, name programming approachBerdasarkan Jadual 6, namakan pendekatan pengaturcaraan(i) X(ii) Y(i) Structured / Berstruktur (ii) Object-Oriented / OOP / Berorientasikan Objek
Source Year
Level
Bloom
KEDAH 2010
3. Figure 10 shows one example of programming approaches used by programmer to17
develop a program.Rajah 10 menunjukkan satu contoh pendekatan pengaturcaraan yang digunakan olehpengaturcara untuk membangunkan satu program.
Figure 10 / Rajah 10 Based on Figure 10, state whether the following statement is True or False.Berdasarkan Rajah 10, nyatakan sama ada pernyataan berikut Benar atau Palsu.(i) The whole program is broken down into modules.
Keseluruhan program dipecahkan menjadi modul- modul.(ii) ADA, Pascal and Visual Basic are examples of programming languages which used
these programming approaches.ADA, Pascal and Visual Basic merupakan contoh - contoh bahasa pengaturcaraanyang menggunakan pendekatan pengaturcaraan ini.
T / FSource Yea
rLevel
Bloom
N. SEMBILAN 2010
15. Match the item of the correct programming language to the given statements below.
Padankan item bahasa pengaturcaraan yang betul berdasarkan pernyataan di bawah.
Item Programming Language
P C++
Q Java
R Prolog
S Machine Language
Table 4 Jadual 4
i. The source code is written in binary. ( )
Kod sumber ditulis dalam binary. ( )
ii. The programming language that inherits objects. ( )
Bahasa pengaturcaraan yang ada perwarisan objek. ( )
Source Year
Level
Bloom
GOMBAK 2008
18. Which of the following is the characteristic of object-oriented programming?
18
A. Can inherit function from other moduleB. Is a waterfall design approachC. Package the data and function into a single unitD. Is associated with a top down approach.
Source Year Level
Bloom
PCGHS 2009
2. State one approach in programming.Nyatakan satu pendekatan dalam pemgaturcaraan.
Source Year Level
Bloom
SPM 2007
Section B
Section C
5.1.3.3 Differentiate between structured approach and object-oriented approach in programming.
Section A
18.
The statements above best describe _____________________________.
Source Year
Level
Bloom
PENANG 2008
20. Integer data type contains any number value that may have a fractional part. Data jenis Integer terdiri daripadai sebarang nilai nombor yang mengandungi nilai pecahan.
19
Main ProgramProgram Utama
InputInput
Read book_LoanBaca
Buku_pinjaman
Read student_record
Baca Rekod_pelajar
Print ReportCetak Laporan
ProcessProses
Read book_RecordBaca
Rekod_buku
Print student_loan recordCetak
Rekod_pinjamanpelajar
It is a programming approach. Decompose the main program into a number of entities Build data and functions around these entities. Bound data closely to the functions.
A
B
B
21. Based on Figure above, match the programming approach with the statement by writing A or B.Berdasarkan Rajah diatas, suaikan kaedah pengaturcaraan dengan penyataan diatas dengan menulis samada A atau B.
i. Often uses a top-down design modelMenggunakan model rekabentuk atas-bawah
ii. Often used object.Menggunakan objek
20
Class Monitor
Ketua Kelas
Muthu, 18
Muthu, 18
Studying
Belajar
Monitoring
the class
discipline
Memantau
disiplin kelas
Object : Student
Objek : Pelajar
Data : Name, Age
Data : Nama, Umur
Function : Studying
Fungsi : Belajar
Librarian
Pustakawan
Chong Seng, 16
Chong Seng, 16
Studying
Belajar
Duty in
library
Bertugas di
perpustakaan
Prefect
Pengawas
Hassan, 17
Hassan, 17
Studying
Belajar
Monitoring
the school
discipline
Memantau
disiplin
sekolah
Source Year
Level
Bloom
PERAK 2008
22. Table 8 shows the differences between Structured Programming and Object Oriented Programming.
Jadual 8 menunjukkankan perbezaan antara Pengaturcaraan Berorientasikan Objek dan
Pengaturcaraan Berstruktur.
P Q
It often uses a top-down design model.
Ia selalunya menggunakan model
rekabentuk atas bawah
It uses combinations of objects.
Ia menggunakan kombinasi objek
Examples - Ada, Pascal and Fortran.
Contoh - Ada, Pascal and Fortran.
Examples - Smalltalk, Java, Visual Basic
and C++.
Contoh - Smalltalk, Java, Visual Basic and
C++.
TABLE 8 JADUAL 8Name P and Q.
Namakan P dan Q.
Source Year Level
Bloom
UNKNOWN
2009
22. Based on Figure 9, match the programming approach with the statement by writing A or B.Berdasarkan Rajah 9,, suaikan kaedah pengaturcaraan dengan penyataan diatas dengan menulis samada A atau B.
iii. Often uses a top-down design modelMenggunakan model rekabentuk atas-bawah
iv. Often used object.Menggunakan objek
A
21
Main ProgramProgram Utama
InputInput
Read book_LoanBaca
Buku_pinjaman
Read student_record
Baca Rekod_pelajar
Print ReportCetak Laporan
ProcessProses
Read book_RecordBaca
Rekod_buku
Print student_loan recordCetak
Rekod_pinjamanpelajar
Class Monitor
Ketua Kelas
Muthu, 18
Muthu, 18
Studying
Belajar
Monitoring the
class discipline
Memantau
disiplin kelas
Object : Student
Objek : Pelajar
Data : Name, Age
Data : Nama, UmurFunction : Studying
Fungsi : Belajar
Librarian
Pustakawan
Chong Seng, 16
Chong Seng, 16
Studying
Belajar
Duty in library
Bertugas di
perpustakaan
Prefect
Pengawas
Hassan, 17
Hassan, 17
Studying
Belajar
Monitoring the
school
discipline
Memantau
disiplin sekolah
B
Figure 9
Source Year Level
Bloom
UNKNOWN
20. Table 3 shows the differences between programming approaches. Jadual 3 menunjukkan perbezaan antara pendekatan pengaturcaraan.
P QIt often uses a top-down design model. Ia selalunya menggunakan model rekabentuk atas bawah
Examples: ADA, Pascal and Fortran. Contoh: ADA, Pascal and Fortran.
It uses combinations of objects. Ia menggunakan kombinasi objek-objek. Examples: Smalltalk, Java, Visual Basic and C++. Contoh: Smalltalk, Java, Visual Basic and C++.
Table 3 Jadual 3Name P. Namakan P.
Source Year Level
Bloom
PERAK 2009
19. Which is the following characteristics are related to an object-oriented programming approach.Antara ciri berikut yang manakah berkaitan dengan pendekatan pengaturcaraan berorientasikan objek?
I.Main routine is broken into smaller sections.Rutin utama dipecahkan kepada unit-unit kecil
II. Data and instructions are seperatedData dan suruhan diasingkan
III. Data and instructions are encapsulated into a single unitData dan suruhan dikurung menjadi satu unit.
22
IV. The programming language is event-drivenBahasa pengaturcaraan adalah pacuan peristiwa.
E. I and II I dan IIF. I and IV I dan IVG. II and III II dan IIIH. III and IV III dan IV
Source Year Level
Bloom
SPM 2008
Section B
1. Figure 11 , shows types of programming approach.Rajah 11, menunjukkan jenis-jenis pendekatan pengaturcaraan
Based on Figure 11, /Berdasarkan Rajah 11,(a) Name the programming approach for : (i) Figure 11 (i)
(ii) Figure 11 (ii) Namakan pendekatan pengaturcaraan bagi : (i) Rajah 11 (i)
(ii)Rajah 11 (ii) :(b) State the differences of approach between the answer in (a)(i) and a(ii).
Nyatakan perbezaan diantara jawapan dalam (a)(i) dan (a)(ii)
(a) (i) Object Oriented/OOP / Berorientasikan Objek(ii) Structured /Struktur
(b) Structured programming uses a top-down design model but theobject-oriented programming approach uses objects.Pengaturcaraan berstruktur menggunakan rekabentukpengaturcaan atas ke bawah manakala pengaturcaraanobjek menggunakan objek.
Source Year
Level
Bloom
23
JOHOR 2010
30. Lim and Harun are programmers. Each of them wrote a program as described in Table 6.
Lim dan Harun merupakan pengaturcara program komputer. Setiap daripada mereka telah menulis program sebagaimana yang diterangkan dalam Jadual 6 di bawah.
Lim HarunProgram beingwrittenProgram yangakandibangunkan
A gaming program which consists of ahero, some treasures and severalmonsters.Program permainan yang mempunyaiwira, harta karun serta beberapapenjahat
A payroll program.Program pembayaran gaji.
Method ofsolving problemKaedahpenyelesaianmasalah
Each character in the program ismodeled as what they are in realworld. They are interrelated in theprogram.Setiap watak dalam program telahdimodelkan sebagaimana dalam dunianyata. Di dalam program ini merekasalin berkait antara satu sama lain.
The entire problem of theprogram is divided into severalsmaller and simpler ones.When each sub-problem issolved, the entire problem isalso solved.Keseluruhan masalah dalamprogram ini dibahagikankepada beberapa bahagiankecil dan dipermudahkan.Apabila setiap masalah kecildiselesaikan, keselurahanmasalah akan turut selesai.
ProgrammingLanguage usedBahasapengaturcaraanyang digunakan
C++ C LanguageBahasa C
Table 6 Jadual 6
Based on Table 6, answer the following questions:Berdasarkan Jadual 6, jawab soalan di bawah.
a) State the programming approaches that are used by Lim and Harun. [ 2 marks ]Nyatakan pendekatan pengaturcaraan yang digunakan oleh Lim dan Harun.
b) Give one difference between these two programming approaches other than stated inTable 6. [ 2 marks ]Berikan satu perbezaan di antara dua pendekatan pengaturcaraan selain daripada yang disebut dalam Jadual 6.
Source Year Level
Bloom
KEDAH 2009
29. Figure 8 shows programming languages approaches used in programming language.
Rajah 8 menunjukkan kaedah bahasa pengaturcaraan yang digunakan dalam bahasa
pengatucaraan.
24
PROGRAMMING LANGUAGE APPROACHES
YX
Figure 8 Rajah 8
a) Define programming language. [2 marks]
Jelaskan bahasa pengaturcaraan. [2 markah]
b) Based on Figure 8, differentiate between X and Y. [2 marks]
Berdasarkan Rajah 8 , bezakan antara X dan Y. [2 markah]
Source Year Level BloomHULU LANGAT 2009
Section C
33. Figure 19 shows one of the approaches that is used in programming.
Rajah 19 di atas menunjukkan satu daripada pendekatan yang digunakan dalam pengaturcaraan.
a) Name the type of programming approach shown in figure (iii) above. Explain the approach. Namakan jenis pendekatan pengaturcaraan yang ditunjukkan dalam rajah (iii) di atas.Terangkan pendekatan ini.
(3 markah)
b) Explain two differences between the approaches shown in figure (iii) and the structured approached in programming.Terangkan dua perbezaan di antara pendekatan di atas dengan pendekatan berstruktur dalam pengaturcaraan.
(4 markah)Source Year Lev
elBloom
UNKNOWN
2009
5.1.4.1 Describe the translation method of programming using assembler, interpreter and compiler.
Section A
25
Object : Teacher
Data : Name, OptionFunction : Teaching
Headmaster :TeacherAbdullah , History
School leader, teaching
Examination TeacherRohayu , Science
Exam. Secretary, teaching
Class TeacherTasnim, Geography
Take attendance,teaching teaching
Figure 19Rajah 19
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.
. read statement and converts to object code / baca pernyataan dan tukar kepada kod objek
. execute line by line / melaksanakan baris demi baris
S is / S adalahA an assembler / penghimpun B a compiler / pengkompilasiC an interpreter / pentafsir D a translator / penterjemahC
Source Year
Level
Bloom
SPM 2010
2. State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.
A translator is a form of hardware that translates a program into the language that the computer can understand.
Penterjemah ialah satu bentuk perkakasan yang menterjemahkan sebuah program ke dalam bahasa yang dapat difahami oleh komputer.FALSE
Source Year
Level
Bloom
KELANTAN 2010
3. Table below shows the differences between Structured Programming and Object Oriented Programming.
Jadual di bawah menunjukkan perbezaan antara Pengaturcaraan Berorientasikan Objek dan Pengaturcaraan Berstruktur
P Q
It often uses a top-down design model.Ia selalunya menggunakan model rekabentuk atas bawah
It uses combinations of objects.
Ia menggunakan kombinasi objek
Examples - Ada, Pascal and Fortran.
Contoh - Ada, Pascal and Fortran.
Examples - Smalltalk, Java, Visual Basic
and C++.
Contoh - Smalltalk, Java, Visual Basic and C++.
Based on table above, name P and Q.
Berdasarkan jadual di atas, namakan P dan Q.
P : __________________________
26
Q : __________________________
P = interpreter Q = compiler
Source Year
Level
Bloom
MELAKA 2010
4. Table 2 shows three methods of programming language translation.Jadual 2 menunjukkan tiga kaedah penterjemahan bahasa pengaturcaraan.
Translator / PenterjemahXDescription /PeneranganTranslate second generation programming language into machine language.Menterjemah bahasa pengaturcaraan generasi kedua kepada bahasa mesin.
Translator / PenterjemahYDescription /PeneranganExecutes instruction line by line until the end of the program.Menterjemah arahan baris demi baris sehingga akhir program.
Translator / PenterjemahZ Description /PeneranganWhen the program running, the object code is loaded into the memory of the computer and the program instructions begin executing.Apabila program dilaksanakan, kod object akan dimuatkan ke dalam memori komputer dan suruhan -suruhan program mula dilaksanakan.
Table 2 / Jadual 2
Based on Table 2, state translator for :Berdasarkan Jadual 2, nyatakan penterjemah untuk :(i) X(ii) Y(iii) ZASSEMBLERINTERPRETERCOMPILER
Source Year
Level
Bloom
N. SEMBILAN 2010
5. Write the word that would complete the following statement:Tulis perkataan yang dapat melengkapkan pernyataan berikut:i) To convert an assembly language source code into machine language, programmer use a
program called a(n) ____________.Untuk menukarkan aturcara sumber bahasa himpunan ke bahasa mesin, pengaturcaraakan menggunakan satu program yang dipanggil ____________.
ii) A(n) _____________ translates and executes one statement at a time.___________ menterjemahkan dan melaksanakan satu arahan pada satu masa.
ASEMBLERINTERPRETER
27
Source Year
Level
Bloom
PERLIS 2010
6. State whether the following statements is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.An assembler translates and executes one statement at a time.Penghimpun menterjemah dan melaksanakan satu pernyataan pada satu masa.FALSE
Source Year
Level
Bloom
PERLIS 2010
7. Figure 10 shows a process in program execution. Rajah 10 menunjukkan satu proses dalam pelaksanaan aturcara.
Based on Figure 10, state Process Y.
Berdasarkan Rajah 10, nyatakan Proses Y. Compiler
Source Year
Level
Bloom
PUTRAJAYA 2010
7. _______________ is used to interpret and execute program directly from its source without compiling it first. While the ________________ will convert the source code into machine code which is a file consisting of binary machine code that can be executed on a computer.
_______________ digunakan untuk mentafsir dan execute program secara terus daripada sumber asal tanpa mengkompil terlebih dahulu. Sementara ____________ akan menukarkan kod sumber kepada kod mesin iaitu fail yang mengandungi kod mesin binary yang boleh di execute dalam komputer
Source Yea Lev Bloom
Source Code
Process X
Process Y ObjectProgram
ProgramExecuted
28
Figure 10
Rajah 10
r elPAHANG 200
8
17. The following statements describe the characteristics of compiler and interpreter.
P Translate code on the fly; no object file is stored in secondary storage.Q Convert all the source code into machine code.R Create an executable file.S Translate and then execute one line of code at a time.T Translate the code each time it is run.
Choose the characteristic(s) of compiler by writing the letter(s) in the space provided.
Source Year
Level
Bloom
PENANG 2008
10. A ……………………… is one of the program translation method that translates a high-level language
into machine language. It will translate the entire programming statement of a program and save it in
an object code file and then executes it later.
Source Year
Level
Bloom
PETALING PERDANA 2008
22. Table 6 shows a number of translators. Jadual 6 menunjukkan beberapa penterjemah.
XASSEMBLERPenghimpun
YINTERPRETER
Pentaksir
ZCOMPILER
Pengkompil
Table 6 Jadual 6Based on Table 6, match the translator with the following statement by writing X, Y or Z.Berdasarkan Jadual 6, padankan penterjemah dengan pernyataan berikut dengan menulis X, Y atau Z.(i) Translates assembly language into machine code. Menterjemah bahasa penghimpun kepada kod mesin.(i) Translates high level language into low level programming language.
Menterjemah bahasa peringkat tinggi kepada bahasa pengaturcaraan
peringkat rendah.
29
Source Year Level
Bloom
UNKNOWN
2008
9. Which of the following programs translates assembly languages into machine code?
A. CompilerB. AssemblerC. InterpreterD. Assembly language compiler
Source Year Level
Bloom
JOHOR 2008
20. Figure 10 shows how is one of the type of programming translator works.Rajah 10 menunjukkan bagaimana salah satu jenis penterjemahan pengaturcaraan melakukan kerja.
Figure 10 Rajah 10What is Y?Apa dia Y?
A. Interpreter B. CompilerPenginterpretasi Pengkompilasi
C. Assembler D. AssemblyPenghimpun Perhimpunan
19
Figure 9
Based on Figure 9, a program that translates the language in (a) to the language in (b) is called ____________.
Y Results
Data
Source Code
30
LOAD R1 5LOAD R2 5ADD R0 R1 R2SAVE R0 6 HALT
10000001001001011000000101000101101000010000011010000010000001101111111111111111
translate
(a) (b)
Source Year Level BloomSARAWAK (A) 2009
17. The statements above best describe _____________________________.
A program used to translate source program into machine code.Translate and then execute one line of code at a time.Translate the code each time it is run.
Source Year Level
Bloom
PCGHS 2009
10 Fill in the blanks with the translation methods given below.Isikan tempat kosong dengan kaedah terjemahan yang diberikan di bawah.
AssemblerPenghimpun
CompilerPengkompil
InterpreterPenterjemah
Table 1 Jadual 1
a) _______________ translates and executes each line of code one at a time.
_______________menterjemah dan melaksana setiap baris arahan pada satu-satu masa.
b) _______________ creates an object code.
_______________ menghasilkan kod objek.
Source Year Level
Bloom
JOHOR 2009
Question 14 are given in the form of statements.
14. Write ‘true’ or ‘false’ in the spaces provided in Answer Sheet .
i. Interpreter is a program that translates programs from assembly language to machine language.Penterjemah ialah sebuah program yang menterjemah dari bahasa himpunan kepada bahasa mesin
ii. Interpreter translates instructions one at a time, and then executes those instructions immediately.Penterjemah menterjemah arahan satu demi satu, dan melaksanakan arahan tersebut secara langsung.
Source Year Level
Bloom
PAHANG
2009
18. i) Name the translator used to translate assembly language to machine language.Namakan penterjemah yang digunakan untuk menterjemah bahasa himpunan kepada bahasa mesin.
31
ii) During the program execution, the ______________ will read the source code line by line and convert it to machine code immediately.Semasa melaksanakan aturcara, _______________ akan membaca kod sumbersecara baris demi baris serta menukarkannya terus kepada kod mesin.
Source Year Level
Bloom
KEDAH 2009
3. Table 7 shows tasks carried out during a program implementation method.
Jadual 7 menunjukkan tugas-tugas yang dijalankan semasa perlaksanaan atur cara.
PTranslate programming language to machine language overall at one time and produce object code file.Menterjemah bahasa pengaturcaraa kepada bahasa mesin secara keseluruhan pada satu masa dan menghasilkan fail kod objek.
QTranslate programming language to machine code and executes it line by line.Menterjemah bahasa pengaturcaraan kepada bahasa mesin baris demi baris.
Based on Table 7, identify the implementation method of program P and Q
Berdasarkan jadual 7, kenalpasti kaedah perlaksanaan aturcara P dan Q
(i) P :
(ii) Q :
Source Year Level
Bloom
KELANTAN
2009
Section B
1. Figure 13 shows the process of two types of translator X and Y.
Rajah 13 menunjukkan proses dua jenis penterjemah X dan Y.
Based on Figure 13Berdasarkan Rajah 13
32
Table 7Jadual 7
(a) Name translatorNamakan penterjemah
i. X
ii. Y[2M]
(b) State a difference between translator X and translator YNatakan perbezaan antara penterjemah x dan penterjemah Y
(a) i- Compiler ii- Interpreter
(b) Kompiler – Menterjemah peryataan pengaturcaraan secarakeseluruhan selepas dikompil Intepereter - Pernyataan aturcara diterjemah secara baris demi baris
Atau : Kompiler – Akan menyimpan satu fail kod objek di dalam cakera apabila dilaksana.
Intepereter – Dilaksanakan secara teru tanpa menyimpan sebarang kod objek.
Source Year
Level
Bloom
PERAK 2010
2. Figure 14 shows the type translators used in different lever of Programming Language.
Based on Figure 14 :Berdasarkan Rajah 14:,(i) State Translator X , Y and the function of X
Nyatakan Penterjemah X , Y dan fungsi X.(ii) Give one differences between Interpreter and Translator Y that are used for High
Level Programming Language. Beri satu perbezaan Pentaksir dan Penterjemah Y yang digunakan untuk Bahasa
Pengaturcaraan Aras Tinggi. (i) X = assembler (1M), Y = compiler (1M)
Function X:
33
Translate an assembly code into the corresponding machine code that can be execute by the computer. (1M)
(ii) Differences between interpreter and Y (1M)Interpreter Y (Compiler)
Translate programming statement line by line and execute it immediately
OrNo object code is saved
Orinterpreter code run slower.
Translate entire programming satement and execute it later
OrStore machine language as object code on the disk
OrCompiled code run faster
Source Year
Level
Bloom
SELANGOR 2010
28. Figure 5(a) and Figure 5(b) show the translation method of programming.
Based on Figure 5(a) and Figure 5(b), answer the following questions.
a) Explain the translation method of programming using X. [2 marks]
b) Explain the translation method of programming using Y. [2 marks]Source Yea
rLevel
Bloom
KEDAH 2008
28 Figure 7 shows 2 types of translation method in programming, X and Y.Rajah 7 menunjukkan 2 kaedah pelaksanaan aturcara, X dan Y.
x
Results
DataSource code
Y
Object Program(binary machine code)
Results
Data
Program Listing
Source code
Figure 5(a) Figure 5(b)
34
Figure 7Rajah 7
Based on Figure 7, answer the following questions:Berdasarkan Rajah 7, jawab soalan berikut:
a) State translator :.Nyatakan penterjemah :
i) X :ii) Y :
c) State two differences between X and Y in program execution.Nyatakan dua perbezaan antara kaedah pelaksanaan aturcara X dan Y.
Source Year Level
Bloom
JOHOR 2009
35
29. Figure 8 shows a process where a translator converts the source code into the machine codes.
Rajah 8 menunjukkan satu proses penterjemah menukarkan kod sumber kepada kod mesin.
(a) Name two translators used in the Programming Language.
Namakan dua penterjemah digunakan dalam bahasa pengaturcaraan.
(a) Describe one of the translators that you have stated in (a).Terangkan satu daripada penterjemah yang anda nyatakan di (a)
Source Year Level
Bloom
KELANTAN
2009
Section C
33. Statement 4 below explains a program that Ahmad needs to build to calculate the marks and grades.Pernyataan 4 di bawah menerangkan program yang perlu dibangunkan oleh Ahmad untuk mengira markah dan gred.
STATEMENT 4 PERNYATAAN 4
Based on Statement 4 :Berdasarkan Pernyataan 4:
(a) State two translation method of programming language used by Ahmad. [ 2 marks]Nyatakan dua kaedah penterjemahan dalam bahasa pengaturcaraan yang digunakan oleh Ahmad
(b) Explain one of the translation methods in (a). [ 1 mark]36
Figure 8Rajah 8
Every year, the co-curriculum unit will give marks and grades to all SPM students. Ahmad is an ICT teacher and given a task to build a program to calculate the marks. He uses Microsoft Visual Basic programming language to complete his task.
Setiap tahun, unit ko-kurikulum akan memberi markah dan gred kepada semua pelajar SPM. Ahmad sebagai guru ICT dan diberi tugas untuk membina satu program untuk mengira markah dan gred tersebut. Beliau menggunakan bahasa pengaturcaraan Microsoft Visual Basic untuk menyiapkan tugasannya.
Terangkan satu daripada kaedah penterjemahan dalam (a)
(c) Differentiate between the translation method of programming language used in (a). [ 4 marks]Bezakan antara kaedah penterjemahan dalam bahasa pengaturcaraan yang digunakan dalam (a)
Source Year Level
Bloom
N.SEMBILAN
2009
5.1.5.1 Differentiate between constants and variables.
Section A
1. Write the correct words to complete the following statement: Tulis perkataan yang betul untuk melengkapkan pernyataan berikut:
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.VARIABLES / CONSTANT
Source Year
Level
Bloom
SPM 2010
2. Figure 9 shows an incomplete program. Rajah9 menunjukkan at urcara yang tidak lengkap.
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= constant
Source Year
Level
Bloom
SPM 2010
3. Read the following situation : /Baca situasi berikut:
This program will calculate the price of an item after 5% discount. The user keys in the price ofthe item and the program will calculate and display the price after discount.Aturcara ini akan mengira harga barang selepas diberi diskaun sebanyak 5%. Pengguna akanmemasukkan harga barang dan aturcara akan mengira dan memaparkan harga selepas diberidiskaun
Based on the situation, name the constant used.Berdasarkan kepada situasi, nyatakan pemalar yang digunakan.Discount/Diskaun
Source Yea Lev Bloom37
r elJOHOR 201
0
4. Figure 6 shows an algorithm to calculate the total of x and y.Rajah 6 menunjukkan algoritma untuk mengira jumlah x dan y.
Figure 6 / Rajah 6Name one variable. / Namakan satu pembolehubah.X OR Y
Source Year
Level
Bloom
JOHOR 2010
5. Figure 7 shows part of programming code Total Parking Charges. Rajah 7 menunjukkan sebahagian daripada kod atur cara Total Parking Charges.
Private Sub calculate_Click()Dim Hour, Minute As IntegerDim Total As Single
msg = "Total Parking Charges is "TimeEntry = ((Total1 * 60) + Total2) / 60
lblCharges.Caption = TimeEntryIf TimeEntry <= 0.5 Then
lblCharges.Caption = msg & "RM0.20"ElseIf TimeEntry > 0.5 AND TimeEntry <= 1 Then
lblCharges.Caption = msg & "RM0.50"ElseIf TimeEntry > 1 AND TimeEntry <= 1.5 Then
lblCharges.Caption = msg & "RM1.50"ElseIf TimeEntry > 1.5 Then
jb = 0.7 + (TimeEntry * 0.8)lblCharges.Caption = msg & "RM" & jb
End If
End Sub
Figure 7Rajah 7
Based on 7 figure, state one :Berdasarkan rajah 7, nyatakan satu :
i. Variable : Pembolehubah:
HOUR / MINUTE / TOTAL38
Source Year
Level
Bloom
KELANTAN 2010
6. Figure 8 shows a portion of a programming code. Rajah 8 menunjukkan sebahagian kod pengaturcaraan.
Figure 8
Rajah 8State oneNyatakan satu
(a) ConstantPemalar
(b) VariablePemboleh ubah
PIE / RADIUS
Source Year
Level
Bloom
PERAK 2010
7. Figure 7 shows part of the code used during a program execution Gambar 7 menunjukkan bahagian kod yang digunakan semasa pelaksanaan program
Private Sub cmdCalculate_Click() Dim radius As Double, area As DoubleConst pie = 3.142 radius = txtWeight.Text area = pie * radius * radius
lblDisplay.Caption =MsgBox(“The area of circle is” & FormatNumber(area, 2))
End SubFigure 7
39
Based on Figure 7, answer the following questions:Berdasarkan Gambar 7, jawab soalan-soalan berikut:
(a) State one constant. Nyatakan satu pemalar(b) State one variable Nyatakan satu pembolehubah
pie / radius
Source Year
Level
Bloom
SABAH 2010
8. Figure 8 shows the flow chart for a program that calculate the area of circle. Rajah 8 menunjukkan carta alir program penghitungan luas bulatan.
Based on Figure 8:Berdasarkan rajah 8:Which element in the program can be define as a constant?Elemen yang manakah pada program merupakan pemalar ?PIE
Source Year
Level
Bloom
SELANGOR 2010
21. Table 5(a) and 5(b) show a statement about programming.
Compiler Assembly Variable Interpreter
The instructions of programming language are written in mnemonic instruction codes.
M
A data container that stores information and the value inside may change at any time during the course of a program.
N 40
Table 5(a)
Based on the table above, match Table 5(a) with Table 5(b)
(i) M =(ii) N =
Source Year
Level
Bloom
KELANTAN 2008
18. Figure 4 shows a portion of a programming code.Rajah 4 menunjukkan sebahagian kod pengaturcaraan.
FIGURE 4 RAJAH 4State oneNyatakan satu
i. Constant Pemalar
ii. Variable Pemboleh ubahSource Year Lev
elBloom
N.SEMBILAN
2009
4. State whether the following statement is True or FalseNyatakan sama ada pernyataan berikut Benar atau Palsu
Figure 4 shows codes written using a particular programming language.Rajah 4 menunjukkan kod yang ditulis menggunakan suatu bahasa pengaturcaraan.
41
Private Sub cmdJaya_Click()
Dim jwp as Stringjwp = lbl1.Caption
If jwp = “Yes” Thenlbl1.Caption = “BERJAYA”
End IfEnd Sub
Table 5(b)
i) The code uses a high-level programming language.
Kod di atas ditulis menggunakan bahas pengaturcaraan aras tinggi.
ii) jwp is a variable in the above code .
jwp merupakan pembolehubah di dalam kod di atas.
Source Year Level
Bloom
KELANTAN
2009
21. Which of the following application is more appropriate to use variable than constant ?
Yang manakah di antara aplikasi berikut yang lebih sesuai menggunakan
pembolehubah berbanding pemalar?
I. The share prices. Harga saham
II. Numbers of hour in a day. Jumlah jam dalam sehari
III. The weight of students in a class. Berat pelajar-pelajar di dalam sebuah kelas
IV. Convertion from kilograms to grams. Penukaran unit kilogram ke unit gram
A. I and II
B. I and III
C. II and IV
D. III and IV
Source Year Level
Bloom
PERLIS 2009
18 Choose the correct statements regarding variables and constants. Pilih pernyataan yang betul tentang pemboleh ubah
I Variables are identifiers. Pemboleh ubah adalah pengecam
II Constants are identifiers. Pemalar adalah pengecam
III Variables are assigned values that may change. 42
Figure 4 Rajah 4
Pemboleh ubah digunakan untuk nilai yang boleh berubah
IV Constants are assigned values that may change. Pemalar digunakan untuk nilai yang boleh berubah
A I, II and III I, II dan IIIB I, II and IV I, II dan IV C I, III and IV I, III dan IV D II, III and IV II, III dan IV
Source Year Level
Bloom
SPM 2009
Section B
1. Table 5 shows a problem statement which is to be written in Visual Basic 6.0.Jadual 5 menunjukkan satu pernyataan masalah yang akan ditulis dalam Visual Basic 6.0.
This program calculates the volume of water to be filled in a cuboid aquarium. Given that the length andwidth of the aquarium is 150 cm and 50 cm respectively. The user will key in the height or level of waterto be filled in the aquarium. Maximum level of water is 70 cm. The program will calculate and display thevolume of water needed based on the water level entered by user.Aturcara ini mengira isipadu air yang perlu diisi ke dalam akuarium berbentuk kuboid. Diberi panjangdan lebar akuarium ialah 150 cm dan 45 cm. Pengguna perlu memasukkan ketinggian atau aras air untukdiisi ke dalam akuarium. Aras air maksimum ialah 70 cm. Aturcara ini akan mengira dan memaparkanisipadu air yang diperlukan berdasarkan ketinggian air yang dimasukkan oleh pengguna..
Table 5 / Jadual 5
a) State the constant and variable to be used. Give the reasons to your answers.Nyatakan pemalar dan pembolehubah yang digunakan. Berikan alasan kepada jawapan anda.
b) Draw user interface for input and output of the program. Lakar antaramuka input dan output bagi aturcara ini.
a) Constant – the length and width has been given Reason: cannot be change if you restart again Variable – the height insert by user
Reason : can insert by user with different value and computer could calculate the volume.b)
43
Source Year
Level
Bloom
PERLIS 2010
Question 28
You are asked to develop a program that will determine the weekly gross pay for each employee of a company. The gross pay of each employee is calculated by the following formula:
weekly gross pay = number of hours worked per week hourly rate + incentive bonus.
The hourly rate for all the employees is RM 10 and the company will pay an incentive bonus of RM 100 for the employees who work for more than 40 hours per week.
(a) Identify a constant and a variable to be used. Give reasons to your answer.
(b) Which control structure is to be used to calculate the weekly gross pay of each employee? Justify your answer. [2 marks]
Source Year
Level
Bloom
PENANG 2008
29. Figure 9 shows the flow chart for a program that converts US Dollar (USD) to Ringgit Malaysia (RM)Rajah 9 menunjukkan carta alir bagi satu atur cara yang menukar US Dollar (USD) kepada Ringgit Malaysia (RM)
44
Figure 9 Rajah 9
Based on Figure 9 : Berdasarkan Rajah 9 :
a) Which element in the program can be defined as a constant?Bahagian yang manakah boleh ditakrifkan sebagai pemalar?
Give one reason for your answer.Berikan satu alasan untuk jawapan anda.
b) What control structure is used?Apakah struktur kawalan yang digunakan?
Give one reason for your answer.Berikan satu alasan untuk jawapan anda.
Source Year Level
Bloom
SPM 2008
29 Figure 12(a) shows the input interface and Figure 12(b) shows the output interface of a program.Rajah 12(a) menunjukkan antara muka input dan Rajah 12(b) menunjukkan antara muka output bagi sebuah program.
45
Start
Enter the amount in USD
Amount_in_RM =Amount_in_USD*exchange_rate
Enter the amount in USD
End
Based on Figure 12(a) and Figure 12(b), Berdasarkan Rajah 12(a) dan Rajah 12(b),
(a) (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.
(b) (i) Should the Numerator declared as a constant?Patutkah Numerator itu diisytiharkan sebagai pemalar?
(ii) Give a reason for your answer.Beri satu alasan bagi jawapan anda.
Source Year Level
Bloom
SPM 2009
Section C
33 Statement 3 shows a problem statement which is to be written in MS Visual Basic 6.0.
Pernyataan 3 menunjukkan satu pernyataan masalah yang akan ditulis dalam MS Visual
Basic 6.0.
46
This program calculates the price of an item after a 10% discount. The user will key in the price of the item. The program will calculate and display the price after discount..
Aturcara ini mengira harga barangan selepas diskaun 10%. Pengguna akan masukkan harga barangan. Aturcara akan mengira dan memaparkan harga selepas diskaun.
STATEMENT 3 PERNYATAAN 3
a) Draw a user interface of the program. [3 marks]
Lukis antaramuka pengguna bagi aturcara ini. [3 markah]
b) State a constant and a variable to be used. Give reasons to your answer.
[4 marks]
Nyatakan satu pemalar dan satu pembolehubah yang akan digunakan. Berikan
alasan kepada jawapan anda. [4 markah]
Source Year Level BloomKL 2008
32 Figure 14 shows goods on sale in a shop.Rajah 14 menunjukkan barang-barang jualan murah di sebuah kedai.
Figure 14 Rajah 14
Based on Figure 14, you are asked to develop a program to calculate the final I)i is c of each item.
Berdasarkan Rajah 14, anda dikehendaki membina satu program untuk menghitung harga muktamad setiap barang.
(a) (i) Identify two variables. Kenalpasti dua pemboleh ubah.
(ii) Justify your answer. Berikan justifikasi anda.
(b) Write the pseudo code for the program. 47
Tulis kod pseudo untuk program itu.
Source Year Level
Bloom
SPM 2009
5.1.5.2 Differentiate between the data types: Boolean, integer, double, string and date.
Section A
1. Figure 9 shows an incomplete program. / Rajah9 menunjukkan at urcara yang tidak lengkap.
Dim Name as XDim PI as YName = "Ali"PI = 3.142
Figure 9 / Rajah 9Based on Figure 9 , identify; / Berdasarkan Rajah 9 , kenalpasti:X= string
Source Year
Level
Bloom
SPM 2010
2. Choose the correct examples regarding data types. Pilih contoh yang betul tentang jenis data.
A I and II B I and IIIC II and IV D III and IVB
Source Year
Level
Bloom
PAHANG 2010
3. Table 4 shows the pseudo code for a program.Jadual 4 menunjukkan kod pseudo untuk satu aturcara.
BeginRequest IDIf ID is equal to AB74G3 then Print “You are allow to access the database”Else Print “Sorry, your ID is not correct”End ifEnd
Table 4 / Jadual 4Based on Table 4,/ Berdasarkan Jadual 4,
48
State the data type for ‘ID’Nyatakan jenis data untuk ‘ID’ String
Source Year
Level
Bloom
PUTRAJAYA 2010
25. Table 7 shows the different data types used in a program.
Cholesterol Indicator For Ria Clinic
Data Type P Integer Double Q
Variable Name PatientID Cholesterol Indicator Normality
ValueAziza 1234 3.35 YES
Nadia 1235 8.10 NO
Table 7
Based on Table7, state the data type for:
i. P ii. Q
Source Year
Level
Bloom
KEDAH 2008
20. Hamzah is asked to develop a program to calculate the average marks of a set of ICT assignments for his class. The variables of this program are identified below:
State an appropriate data type for each of the following variables.(a) Identity card number(b) Average
Source Year
Level
Bloom
PENANG 2008
11. Data type determines the type of data a variable can store. Match the following statements by writing
A, B, C, or D.
49
A
B
C
D
Identity card numberName
GenderAssignment 1Assignment 2Assignment 3
Average
Table 3
i. This data type contains either a true or false value.
ii. This data type contains any decimal number value that has a fractional part.
iii. This data type contains a sequence of character.
Source Year
Level
Bloom
PETALING PERDANA 2008
25. Questions 25 are in statements form. Write True or False for the following statements.Soalan 25 adalah dalam bentuk pernyataan. Tuliskan Benar atau Palsu bagi pernyataan-pernyataan berikut.
i. Boolean data type consists of either True or False value.Operator jenis data Boolean terdiri daripada nilai benar atau palsu.
ii. Integer data type contains any number value that may have a fractional part.Data jenis Integer terdiri daripada sebarang nilai nombor yang mengandungi nilai pecahan.
Source Year Level
Bloom
UNKNOWN
2008
8. Which of the following are related to types of data?
Antara berikut yang manakah berkaitan dengan jenis data?
I. String Aksara
II. Variable Pembolehubah
III. Boolean Boolean
IV. Double Berganda
A. I, II and III
B. I, II and IV
C. I, III and IV50
D. II, III and IV
Source Year Level
Bloom
UNKNOWN
2009
22. Based on Table 3, match A, B, C or D for the following statements
Berdasarkan jadual 3, padankan A, B, C atau D untuk pernyataan berikut.
Table 3 Jadual 3
a. Any number value that may and could contain a fractional part
Nilai yang mungkin mengandungi pecahan
b. This data type consist either a true or false value.
Jenis data yang mengandungi nilai sama ada benar atau palsu.
Source Year Level BloomHULU LANGAT 2009
22. Table 01 shows the result of ICT.Jadual 01 menunjukkan keputusan ICT.
Based on Table 01, fill the data type according to the column Berdasarkan Jadual 01 isi jenis data yang sesuai a. W is ________________b. X is ________________c. Y is ________________
Source Year Level
Bloom
WPKL 2009
19 Choose the best answer according to the data types below.
Pilih jawapan yang terbaik berdasarkan jenis data di bawah.
Integer Boolean Double String
(a) Data type that contains any whole number value that does not have any fractional part.
Jenis data yang mengandungi keseluruhan nilai nombor kecuali nombor pecahan.
(a) Any value that contains a sequence of characters.
integerdoublestringboolean
W X Y Z
51
Sebarang nilai yang mengandungi jujukan aksara.
Source Year Level
Bloom
N.SEMBILAN
2009
23. Integer data type contains any number value that may have a fractional part. Data jenis Integer terdiri daripadai sebarang nilai nombor yang mengandungi nilai pecahan. True or False
Source Year Level
Bloom
UNKNOWN
21. Choose the best answer according to the data types. Pilih jawapan terbaik berdasarkan jenis data.
Integer DoubleBoolean String
(i) Data type which contains any whole number value that does not have any fractional part. Jenis data yang mengandungi sebarang nombor bulat yang tiada sebarang pecahan.
(ii) Any value that contains a sequence of characters.Sebarang nilai yang mengandungi jujukan aksara.
Source Year Level
Bloom
PERAK 2009
19 Table 3 shows some types of data.Jadual 3 menunjukkan beberapa jenis data.
Types of dataJenis Data
ItemPerkara
R True or False valuesNilai Benar atau Palsu
S Whole numbersNombor bulat
Table 3Jadual 3
Based on Table 3, state the types of data for: Berdasarkan Jadual 3, nyatakan jenis data untuk:(i) R(ii) S
Source Year Level
Bloom
SPM 2009
Section B
52
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.
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.String (text)Can combine beetween number, text or symbol
Source Year
Level
Bloom
SPM 2010
26 Based on the situation given, answer the following question: Berdasarkan situasi yang diberi, jawab soalan-soalan berikut:
Yusoff is the manager of Koperasi SMK Mutiara Gombak. To increase the sale for the month of September, he has decided to offer a discount of 10 percent to all his students who spend more than RM 10 on an item. Yusoff needs a program to calculate the total sale for the students after deducting the offered discount. As an ICT student, you are asked to develop the program and create user’s manual in Phase X.
Yusoff adalah pengurus Koperasi SMK Mutiara Gombak. Bagi meningkatkan jualan pada bulan September, Yusoff bercadang untuk memberikan diskaun ke atas mana-mana barang yang bernilai lebih dari RM 10 bagi satu item. Beliau memerlukan satu program untuk membantu beliau mengira jumlah harga barangan yang dibeli setelah ditolak diskaun. Sebagai pelajar ICT, anda diminta membangunkan program tersebut dan menghasilkan manual pengguna di dalam fasa X.
Situation 3Situasi 3
(a) State the items for the program that you are going to develop.
Nyatakan item yang terkandung dalam program anda.
i) Input Item : Item input :
ii) Output item :
53
Item output :[2 marks]
(b) Write a data type of each following:Tuliskan jenis data bagi setaip yang berikut:
i) Discount :Diskaun :
ii) Total sale : Jumlah jualan :
[2 marks]
Source Year
Level
Bloom
GOMBAK 2008
28 Figure 15(a) shows part of the code used and Figure 15(b) shows an error message displayed during a program execution.
Private Sub cmdCalculate_Click()
Dim dblWeight As Double, dblHeight As Double, dblBMI As DoubleConst strMSG As String
dblWeight = Val(txtWeight.Text)
dblHeight = Val(txtHeight.Text)strMSG = "Your BMI is "
dblBIM = dblWeight / (dblHeight * dblHeight)
lblDisplay.Caption = strMSG & FormatNumber(dblBMI, 2)
End Sub
(a)
(b)
Figure 15
54
Base on Figure 15,
(c) Identify the type of error uncovered during the program execution and write the correct code for the mentioned error. [2 marks]
(d) State two differences between strMSG and dblBMI. [2 marks]
Source Year Level BloomSARAWAK (A) 2009
29 Figure 12(a) shows the input interface and Figure 12(b) shows the output interface of a program.Rajah 12(a) menunjukkan antara muka input dan Rajah 12(b) menunjukkan antara muka output bagi sebuah program.
Based on Figure 12(a) and Figure 12(b), Berdasarkan Rajah 12(a) dan Rajah 12(b),
(a) (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.
(b) (i) Should the Numerator declared as a constant?Patutkah Numerator itu diisytiharkan sebagai pemalar?
(ii) Give a reason for your answer.Beri satu alasan bagi jawapan anda.
Source Year Level
Bloom
SPM 2009
Section C
1. As an ICT student, Abu is asked to develop a program to calculate the price of bus ticket forseveral destinations in a special promotion during the school holidays. Here is the algorithm:
55
Sebagai pelajar ICT, Abu diminta membangunkan aturcara yang dapat mengira harga tiket bassempena promosi istimewa untuk pelbagai destinasi sepanjang cuti sekolah. Algorithmaaturcata tersebut adalah seperti berikut:
BeginRead DestinationRead Ticket priceRead number of adultRead number of childrenIf passenger buy more than three tickets or amembership card holderGive 10% discountCalculate a ticket price for adultCalculate a ticket price for childrenCalculate the amount of the ticketsCalculate and display the total price after discountElseNo discount givenCalculate the ticket price for adultCalculate the ticket price for childrenCalculate the amount of the ticketsCalculate and display the total price without discountEnd
Figure 12 / Rajah 12
(a) Determine two data types used in the program.Tentukan dua jenis data yang digunakan di dalam aturcara..
- String- Integer- DoubleAny two answers.Mana-mana dua jawapan
Source Year
Level
Bloom
JOHOR 2010
33. The following statement explains the operation of a taxi company.Pernyataan berikut menerangkan tentang operasi sebuah syarikat teksi.
56
Smart Cab is a taxi company operating in Seri Wangi Mall. The company is going to use computers for its coupon system.
The coupon should display the following data items : Receipt number (auto generated) Cashier’s name Date Fare
Smart Cab ialah sebuah syarikat teksi yang beroperasi di Seri Wangi Mall. Syarikat tersebut akan menggunakan komputer untuk sistem kuponnya.
Kupon tersebut mestilah memaparkan item data berikut: Nombor resit (dijana secara automatik) Nama juruwang Tarikh Tambang
Based on the above statements : Berdasarkan penyataan itu :
a) State the data type for the first three data items required for the coupon systemNyatakan jenis data untuk tiga item data pertama yang diperlukan untuk system kupon itu.
b) Using the information and data given in the statement, create the output of the coupun that will be used by the taxi company.Dengan menggunakan maklumat dan data di dalam pernyataan, hasilkan kupon yang akan digunakan untuk syarikat teksi itu.
Source Year Level
Bloom
SPM 2008
5.1.5.3 Differentiate between mathematical and logical (Boolean) operators.
Section A
1. Table below shows examples of operator symbols that being used in programming.
Jadual di bawah menunjukkan contoh simbol-simbol operator yang digunakan dalam
pengaturcaraan.
S ‘ OR ‘ ‘ AND’
T ‘ * ‘ ‘ + ‘
U ‘ < ‘ ‘ > ‘
Based on table above, write S, T or U for the following operator types.
Berdasarkan jadual di atas, tuliskan S, T atau U bagi jenis-jenis operator berikut:
i. Logical Operator
Operator Logikii. Mathematical Operator
Operator Matematiki) Sii) T
Source Year
Level
Bloom
MELAKA 2010
2. Figure 7 shows part of programming code Total Parking Charges.57
Rajah 7 menunjukkan sebahagian daripada kod atur cara Total Parking Charges.Private Sub calculate_Click()Dim Hour, Minute As IntegerDim Total As Singlemsg = "Total Parking Charges is "TimeEntry = ((Total1 * 60) + Total2) / 60
lblCharges.Caption = TimeEntryIf TimeEntry <= 0.5 Then
lblCharges.Caption = msg & "RM0.20"ElseIf TimeEntry > 0.5 AND TimeEntry <= 1 Then
lblCharges.Caption = msg & "RM0.50"ElseIf TimeEntry > 1 AND TimeEntry <= 1.5 Then
lblCharges.Caption = msg & "RM1.50"ElseIf TimeEntry > 1.5 Then
jb = 0.7 + (TimeEntry * 0.8)lblCharges.Caption = msg & "RM" & jb
End If
End Sub
Figure 7 /Rajah 7
Based on 7 figure, state one :Berdasarkan rajah 7, nyatakan satu :
Logical Operator:Operator Logik:AND
Source Year
Level
Bloom
KELANTAN 2010
3. Table 4 shows some types of operator element in programming.Jadual 4 menunjukkan beberepa jenis elemen operator dalam pengaturcaraan.
Table 4 / Jadual 4Based on Table 4, state the types of operator for:Berdasarkan Jadual 4, nyatakan jenis operator bagi:(i) R (ii) S(i) Mathematical (ii) Relational
Source Year
Level
Bloom
PAHANG 2010
4. State whether the following statements is TRUE or FALSE
58
Nyatakan sama ada kenyataan berikut adalah TRUE atau FALSEa. Boolean data types consists either a True or False value. Programmers usually use it to store status. jenis data
Boolean terdiri daripada sama ada nilai Benar atau Salah. Programer biasanya menggunakannya untuk menyimpan status
b. Logical operators are notations that tell the computer to perform logical operations. Examples of logical operation are Plus, Minus, Multiply and DivideOperator Logik memberitahu komputer untuk melakukan operasi logik. Contoh operasi logik Tambah, Tolak, Darab dan BahagiT / F
Source Year
Level
Bloom
SABAH 2010
5. Figure 7 shows types of operator. Rajah 7 menunjukkan jenis-jejis operator
Figure 7 / Rajah 7
Based on figures 7, state two logical operatorsBerdasarkan Rajah 7 , nyatakan dua operator logik.OR / NOTNOT / OR
Source Year
Level
Bloom
SELANGOR 2010
6. Figure 11 shows the operator used in programming.Rajah 11 menunjukkan operator yang digunakan di dalam aturcara.
Figure 11
OR
>=
+ -
NOT
59
Rajah 11Based on Figure 11, state the operator used.
Berdasarkan Rajah 11, nyatakan operator yang digunakan. Mathematical
Source Year
Level
Bloom
PUTRAJAYA 2010
20 Which of the following is a logical operator?
A. OR B. MINUSC. DIVIDED. CONSTANT
Source Year Level BloomSARAWAK (A) 2009
Source Year Level
Bloom
TERENGGANU 2009
19 Figure 4 shows the types of operators used in Programming Language.Rajah 4 menunjukkan jenis operator yang digunakan dalam Bahasa
Pengaturcaraan.
60
Figure 4 Rajah 4
(a) Name Y.Namakan Y.
(b) Give one example of YBeri satu contoh Y
Source Year Level
Bloom
JOHOR 2009
19. Which of the following are the correct examples of operators?Manakah diantara berikut merupakan contoh-contoh operator yang betul?
Source Year Level
Bloom
KEDAH 2009
17. ‘<’ and ‘ + ’ symbols are examples of ____________________
Simbol ‘ < ’ dan ‘ + ’ adalah contoh ___________________.
Source Year Level
Bloom
SPM 2007
20 Figure 10 shows types of operator.61
Rajah 10 menunjukkan jenis-jenis operator.
Figure 10 Rajah 10
Based on Figure 10, state two logical operators. Berdasarkan Rajah 10, nyatakan dua operator logik.
Source Year Level
Bloom
SPM 2009
Section B
28. Figure 7 shows the operators used in programming development.Rajah 7 menunjukkan operator yang digunakan dalam pembangunan pengaturcaraan.
Figure 7 (i) Figure 7 (ii) Rajah 7 (i) Rajah 7 (ii)
FIGURE 7 RAJAH 7Based on Figure 7 :Berdasarkan Rajah 7 :
(a) Identify the operator used in Figure 7(i) and 7(ii).
Kenalpasti operator yang digunakan dalam Rajah 7(i) dan 7(ii ).
(b) Based on your answer in ( a ) differentiate between operator in 7( i ) and 7( ii ).
Berdasarkan jawapan anda dalam (a) bezakan operator dalam 7(i) dan 7 (ii).
62
Source Year Level
Bloom
N.SEMBILAN
2009
Section C
1. As an ICT student, Abu is asked to develop a program to calculate the price of bus ticket forseveral destinations in a special promotion during the school holidays. Here is the algorithm:Sebagai pelajar ICT, Abu diminta membangunkan aturcara yang dapat mengira harga tiket bassempena promosi istimewa untuk pelbagai destinasi sepanjang cuti sekolah. Algorithmaaturcata tersebut adalah seperti berikut:
BeginRead DestinationRead Ticket priceRead number of adultRead number of childrenIf passenger buy more than three tickets or amembership card holderGive 10% discountCalculate a ticket price for adultCalculate a ticket price for childrenCalculate the amount of the ticketsCalculate and display the total price after discountElseNo discount givenCalculate the ticket price for adultCalculate the ticket price for childrenCalculate the amount of the ticketsCalculate and display the total price without discountEnd
Figure 12 / Rajah 12
(b) (i) State two types of operators used in the program above.Nyatakan dua jenis operator yang digunakan dalam aturcara di atas
(ii) Explain the differences between operators in answer (b)(i).Terangkan perbezaan di antara operator dalam . jawapan (b)(i).
(i) - Mathematical Operator- Operator Aritmetik/Matematik- Logical Operator- Operator Logik
(ii) Mathematical operators perform mathematical operations such as plus or subtractbut logical operators logical operators perform logical operations such as checking the condition of two Boolean values. Operator matematik menjalankan operasi matematik Seperti tambah atau tolakmanakala operator logic digunakan untuk membandingkan dua keadaan mengikut nilai Boolean.Explanation on mathematical operators – 1 mark.Penerangan untuk operator matematik – 1 markah.Explanation on logical operator – 1 markPenerangan untuk operator logik – 1 markah.Examples of mathematical or logical operator – 1 mark maximum.Contoh untuk operator matematik atau operator logik – maksima 1 markah.
Source Yea Lev Bloom
63
r elJOHOR 201
0
5.1.5.4 Differentiate between sequence control structure and selection control structure.
Section A
1. Figure 7 shows a pseudo code.Rajah 7 menunjukkan satu kod pseudo.
Figure 7 / Rajah 7Which of the following flow chart represents the pseudo code in Figure 7.Yang manakah antara carta alir berikut menggambarkan kod pseudo dalam Rajah 7.
D
Source Year
Level
Bloom
PAHANG 2010
64
1. 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.
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)SEQUENCE CONTROL STRUCTURESELECTION CONTROL STRUCTURE
Source Year
Level
Bloom
SPM 2010
5. Which type of control structure is represented by the following pseudo code?Struktur kawalan manakah yang diwakili oleh kod pseudo di bawah?
A. Decision Control StructureStruktur Kawalan Keputusan
B. Repetition Control StructureStruktur Kawalan Pengulangan
C. Sequence Control StructureStruktur Kawalan Jujukan
65
D. Selection Control StructureStruktur Kawalan Pilihan
C
Source Year
Level
Bloom
N. SEMBILAN 2010
6. Figure 11 shows one symbol of flow chart.Rajah 11 menunjukkan satu simbol dalam carta alir.
Figure 11 / Rajah 11Name Y.Namakan Y.INPUT OUTPUT
Source Year
Level
Bloom
N. SEMBILAN 2010
7. Table 4 shows types of control structure. Jadual 4 menunjukkan jenis struktur kawalan.
A Selection control structure struktur kawalan pilihan
B Repetition control structure struktur kawalan PengulanganC Sequence control structure struktur kawalan jujukanD Consecutive control structure struktur kawalan turutan
Table 4 / Jadual 4
Match A, B, C, and D in Table 4 with the following statements: Padankan A, B, C, dan D dalam Jadual 4 dengan kenyataan berikut:
i. Enables the programmer to assign different events for different situations. Programmers can use it to implement decision making process. Membolehkan programmer untuk menetapkan acara yang berbeza untuk situasi yang berbeza. Pengaturcara boleh menggunakannya untuk melaksanakan proses pengambilan keputusan
ii. Executes statements one by one in linear or consecutive order Melaksanakan satu demi satu dalam urutan linear atau berturut-turut
A / C
Source Year
Level
Bloom
SABAH 2010
8. Figure 9 shows the flow chart of a Progamme Rajah 9 menunjukkan carta alir bagi satu Program
66
Figure 9 / Rajah 9
Based on figure 9, Berdasarkan rajah 9,Name the control stuctured used the programme.Namakan jenis struktur kawalan yang digunakan dalam program.SEQUENCE CONTROOL STRUCTURE
Source Year
Level
Bloom
SELANGOR 2010
9. Table 4 shows the pseudo code for a program.Jadual 4 menunjukkan kod pseudo untuk satu aturcara.
BeginRequest IDIf ID is equal to AB74G3 then Print “You are allow to access the database”Else Print “Sorry, your ID is not correct”End ifEnd
Table 4 / Jadual 4Based on Table 4,/ Berdasarkan Jadual 4,State the type of control structure is used in the pseudo code.Nyatakan jenis struktur kawalan yang digunakan di dalam kod pseudo.Selection
Source Year
Level
Bloom
PUTRAJAYA 2010
67
18
The type of control structure that is best represented by the above pseudocode is
A. selection control structureB. sequence control structureC. repetition control structureD. consecutive control structure
Source Year Level BloomSARAWAK
(A)2008
19 Text only sentences that describe the logic and program flow of a computer program is known as ………………
Source Year Level BloomSARAWAK
(A)2008
21 Figure 10 shows the flowchart for a program
Figure 10
No
START
READ Mark
PRINT “Fail”
STOP
Mark >=35?
PRINT “Pass”Yes
68
BEGIN Request student’s weight If student’s weight is more than or equal to 50 kg Then Print “You are too heavy to ride the toy car.” Else Print “you can ride the toy car.” End IfEND
Based on Figure 10, the flowchart uses
E. selection control structure.F. sequence control structure.G. repetition control structure.H. consecutive control structure.
Source Year Level BloomSARAWAK (A) 2009
19. FIGURE 6 shows the pseudocode of a program that calculates net pay.
BeginRead HoursWorked, HourlyRateGrossPay = HoursWorked x HourlyRateDed401K = GrossPay x 0.055Medicare = GrossPay x 0.0145SocSec = GrossPay x 0.0765TotDeductions = Ded401K + Medicare + SocSecNetPay = GrossPay - TotDeductionsDisplay NetPayEnd
FIGURE 6State the type of control structure used.
Source Year Level
Bloom
PCGHS 2009
Question 15-16 : Fill in the blanks with correct answersSoalan 15-16 : Isikan tempat kosong dengan jawapan yang betul
15.
i. The usual program statement associated with the use of IF...THEN...ELSE, where you do one thing or another based on the outcome.This control structure refers to ______________.
Pernyataan yang biasa digunakan ialah penggunaan IF...THEN...ELSE, dimana pelaksanaan sesuatu perkara atau sebaliknya bergantung kepada hasilnya. Struktur kawalan ini merujuk kepada __________ .
ii. A ________________is a series of statements (operations) that do not involve choices or repeating in a programming’s control structure.
69
BeginMula
Y
ProcessProses
X
EndTamat
_______________ialah pernyataan yang tidak melibatkan pemilihan atau pengulangan dalam sebuah struktur kawalan pengaturcaraan.
Source Year Level
Bloom
PAHANG
2009
State whether the following statement is True or False.Nyatakan sama ada pernyataan berikut Benar atau Palsu.
17. Sequence control structure executes program statements in linear order while selection control structure executes different statements for different condition.
Struktur kawalan jujukan melaksanakan aturcara secara berjujukan manakala struktur kawalan bersyarat melaksanakan aturcara mengikut pernyataan bersyarat.
Source Year Level
Bloom
KEDAH 2009
20. A _________ control structure enables the programmer to assign different events for different
situations.
Sruktur Kawalan ________ membenarkan pengaturcara untuk menentukan peristiwa yang berbeza
untuk situasi yang berbeza.
Source Year Level BloomHULU LANGAT 2009
19. Figure 4 shows the main element in the flow chart
Rajah 4 menunjukkan elemen utama dalam carta alir.
Which of the following is suitable to represent X.
70
Figure 4Rajah 4
Yang manakah berikut adalah sesuai untuk mewakili X
A. Input Input
B. Output Output
C. Decision Pilihan
D. Calculation Pengiraan
Source Year Level BloomHULU LANGAT 2009
21. Students who are not qualified to receive the fund will show program response “Sorry, please try to apply next year.” is an example of _______________ identified by the programmer. Pelajar yang tidak layak menerima sumbangan akan dipaparkan tindakbalas “Maaf cuba lagi memohon di tahun hadapan”, contoh tersebut adalah ______________ yang dikenalpasti oleh pengaturcara.
A. inputB. outputC. processD. purpose
Source Year Level
Bloom
WPKL 2009
18. State whether the following statement is True or False. Nyatakan sama ada pernyataan berikut Benar atau Palsu.
Pseudocode is the English-like statements that follow a loosely defined syntax and are used to convey the design of an algorithm.
Pseudocode ialah pernyataan seperti Bahasa Inggeris yang mengikut sintax dan digunakan untuk mereka sesebuah algorithma.
Source Year Level
Bloom
PUTRAJAYA 2009
16. Figure 3 shows a flowchart.
Rajah 3 menunjukkan sebuah carta alir.
The control structure used in Figure 3 is ________________________.
71
FIGURE 3
RAJAH 3
Struktur kawalan yang digunakan di dalam Rajah 3 adalah _______________________.
Source Year
Level
Bloom
N. SEMBILAN
2009
18. Figure 8(a) and 8(b) show flowchart segmentsRajah 8(a) and 8(b) menunjukkan segment carta alir
Figure 8(a) Figure 8(b)Rajah 8(a) Rajah 8(b)
Identify the control structure used inKenalpasti struktur kawalan yang digunakan dalam
i) Figure 8(a) : Rajah (a) :
ii) Figure 8(b) : Rajah (b) :
Source Year Level
Bloom
SPM 2007
21 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?
A
B
C
D
Source Year Level
Bloom
SPM 2009
17. State whether the following statement is True or FalseNyatakan sma ada pernyataan berikut Benar atau Palsu.
Figure 7 shows the flow chart of the a programRajah 7 menunjukkan carta alir bagi satu atur cara.
72
Figure 7 Rajah 7
The above flow chart has a selection control structure.Carta alir di atas mempunyai struktur kawalan pilihan.
Source Year Level
Bloom
SPM 2008
Section B
1. Figure 12 below shows one of the phases in program developmentGambar 12 di bawah ini menunjukkan salah satu fasa dalam pembangunan program
Figure 12
Based on the flow chart above, answer the following questions: Berdasarkan diagram alir di atas,jawab soalan-soalan berikut:
a. There are mistakes in the flow chart above. Identify them by re-drawing with the correct symbol.Terdapat kesalahan dalam carta alir di atas. Kenalpastinya dengan melukis kembali denganmenggunakan simbol yang benar.
b. (i) Name the phase that involve the flow chart above.Namakan fasa yang melibatkan diagram alir di atas
(ii) What is the output if X = 6 and Y = 9?Apa output jika X = 6 dan Y = 9?
Print “X is greater than Y”
Read X, Y
Start
End
Print “X is less than or equal to Y”X > Y
TRUE
FALSE
73
a)
b) (i) program design(ii) X is less than or equal to Y
Source Year
Level
Bloom
SABAH 2010
2. Figure 13(a) and 13(b) show flow charts of two programs.
Rajah 13(a) dan Rajah 13(b) menunjukkan carta alir bagi dua program.
Based on Figure 13(a) and Figure 13(b) / Berdasarkan Rajah13(a) dan Rajah 13(b),(a)
Input Item Input DataX 12
74
Table kJadual k
START
READ X
END
X = X+ 20
PRINT X
Figure 13(a)Rajah 13(a)
Table 6
START
END
X > 20
X = X + 20 X = X- 2
READ X
PRINT X
Figure 13(b)Rajah 13(b)
Yes No
Write the Output for the flowchart in figure 13(a) and 13(b) based on the Input Data in the Table 6.Tuliskan output untuk carta alir dalam Rajah 13(a) dan 13(b) berdasarkan data input di dalam Jadual 6.
(i) 13(a) (ii) 13(b)
(b) What control structure is used in Figure 13(b). Give a reason.Apakah struktur kawalan yang digunakan dalam Rajah 13(b).Berikan alasan.
(a) (i) (ii)
(b)
x(a) 32x(b) 10Types of control structure in x(b): Selection Control StructureReason: The program has the decision symbol
Source Year
Level
Bloom
KELANTAN 2010
27. Figure 6(a) and 6(b) show the flowchart of two types of control structures in programming.Rajah 6(a) dan 6(b) menunjukkan carta alir bagi dua jenis struktur kawalan dalam pengaturcaraan.
Figure 6(a) Figure 6(b)Rajah 6(a) Rajah 6(b)
State two differences between Figure 6(a) and 6(b).Nyatakan dua perbezaan antara Rajah 6(a) dan 6(b).
[ 4 marks ]Source Year Lev
elBloom
UNKNOWN
2008
30. In order to encourage students to achieve excellent performance in co-curricular activities, a merit certificate is awarded to students who have achieved at least 80 marks in all three categories of co-curricular activities. A sample data is shown I TABLE 7.
Marks for each category Awarded certificateUniform Unit Society Game
85 83 90 Yes75 82 85 No
TABLE 7
75
You are asked to develop a program that prints merit certificates for eligible students. The following is the program logic.
BEGIN Read student’s name, identity card number Read marks obtained in uniform unit Read marks obtained in society Read marks obtained in game If expression 1 then Print certificate for this student End ifEND
(a) Are the variables student’s name and marks for each category using the same data type? Give reason to your answer. [ 2 marks ]
(b) Write a logical expression for expression 1. [ 2 marks ]
Source Year Level
Bloom
PCGHS 2009
30. Figure 6 shows the five phases involved in program development. Based on the figure, answer the following questions.Rajah 6 menunjukkan 5 fasa pembangunan aturcara. Berdasrkan gambarajah jawab soalan berikut
Figure 6 Rajah 6
a. Name and describe phase X.Nama dan terangkan fasa 4
[3 Marks]b. Draw a flowchart to show how a program calculates the area of a rectangle.
Lukis cartalir untuk menunjukkan bagaimana program mengira luas segiempat[4 Marks]
Source Year Lev Bloom
76
elPAHAN
G2009
29.Figure 13 is a flow chart (diagram) using symbols.Rajah 13 menunjukkan carta alir (diagram) menggunakan simbol-simbol.
FIGURE 13RAJAH 13
a) Based on the figure above, name the symbol of X and Y. [2 marks]Berdasarkan Rajah di atas, nama symbol X dan Y . [2 markah]
b) Verify the usage of X and Y. [2 marks]Kenalpasti kegunaan X dan Y. [2 markah]Source Year Lev
elBloom
UNKNOWN
29 Figure 9 shows examples of program written in different control structures.Rajah 9 menunjukkan contoh aturcara ditulis dalam struktur kawalan yang berbeza.
77
Y
Begin
Request mark from program
Mark >=50?
End
Print “ Congratulatio
ns”
Print “ Don’t give
up!”
X
A B
Based on Figure 9:
Berdasarkan Rajah 9:
(a) State the control structures used in A and B.Nyatakan struktur kawalan yang digunakan bagi A dan B.
(b) Give one difference between these two control structures.Berikan satu perbezaan di antara kedua-dua struktur kawalan ini.
Source Year Level
Bloom
PERAK 2009
29. Figure 9 shows the flow chart for a program that converts US Dollar (USD) to Ringgit Malaysia (RM)Rajah 9 menunjukkan carta alir bagi satu atur cara yang menukar US Dollar (USD) kepada Ringgit Malaysia (RM)
Figure 9 Rajah 9
78
Start
Enter the amount in USD
Amount_in_RM =Amount_in_USD*exchange_rate
Enter the amount in USD
End
Figure 9Rajah 9
BA
Based on Figure 9 : Berdasarkan Rajah 9 :
a) Which element in the program can be defined as a constant?Bahagian yang manakah boleh ditakrifkan sebagai pemalar?
Give one reason for your answer.Berikan satu alasan untuk jawapan anda.
b) What control structure is used?Apakah struktur kawalan yang digunakan?
Give one reason for your answer.Berikan satu alasan untuk jawapan anda.
Source Year Level
Bloom
SPM 2008
Section C
2. Figure 18 shows development of a programme. Rajah 18 menunjukkan pembangunan satu program
Pseudo Code
BEGINKey in students’ data (verify data)
If all fields filled thenPrint curriculum unit
ElsePrint error message
End ifEND
Figure 18 / rajah 18
Based on the case study and pseudo code at figure 18: Berdasarkan kajian kes dan kod pseudo pada rajah 18:a. Identify the input, process and output of the program.
Kenalpasti input, proses dan output program . b. Based on the Pseudo code given, draw a suitable flow chart to show the flow of program.
Berdasarkan kod pseudo yang diberi, lakarkan carta alir yang sesuai program berkenaan. Input – name, class and IC number (1M)
Output – Curriculum Unit (1M)Process – verifies the students data and all fields are filled (1M)
Case Study
Your school needs a registration program to computerize the registration of Curriculum Unit. Any student in the school should have all 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, they will notified of his/her Curriculum Unit for the coming academic year.
79
- BEGIN/END (1m)- Correct Decision if and description (1m)- Correct Input/Output shape and description
(1m)- All arrow must reach the shapes (1m)
Flow chart:
Source Year
Level
Bloom
SELANGOR 2010
3. Table 8 shows statement about a programming project.Jadual 8 menunjukkan pernyataan tentang satu projek pengaturcaraan.
BEGIN
Request Name, Class, IC number
END
All fields filled
Display error message
Display Curriculum Unit
NO
YES
80
Alia is a form 5 Cyber student who is taking ICT subject. She is required to write a program to calculate the area of a circle by using the formula, area of circle =πr2 . The program should allow the user to key‐in the radius o the circle. Use a formula to calculate and display the area of the circle.
Alia adalah pelajar tingkatan 5 Cyber yang mengambil mata pelajaran ICT. Dia dikehendakki menulis aturcara untuk mengira luas bulatan dengan menggunakan formula, Luas bulatan = πr2 . Aturcara tersebut meminta pengguna memasukkan nilai jejari bulatan. Gunakan formula untuk mengiradan paparkan hasilnya.
Table 8 / Jadual 8
(i) What are the input, process and output of the program?Apakah input, proses dan output bagi aturcara ini?
(ii) Draw a flowchart for the program.Lukis carta alir bagi program tersebut.
(i) Input: radiusProcess: calculate the area of a circleOutput: area of circle
(ii)
Source Year
Level
Bloom
KEDAH 2010
Question 33Figure 8 shows a Visual Basic coding to calculate the area of a circle.
81
Based on Figure 8,
a) Give the differences between the declaration of A and B. [3 marks]
Figure 9 shows the flow charts of control structures.
ure 2
b) State two differences between control structure X and control structure Y. [4 marks]
Source Year
Level
Bloom
KEDAH 2008
33 Based on the case study and pseudo code below, answer the following questions.
Berdasarkan kajian kes dan kod sumber di bawah, jawab soalan-soalan berikut.
82
Private Sub Calculate_Click( )Dim A As IntegerConst B = 3.142
A = txtA.TextArea = A * A * Blbldisplaycircle.Caption = Area End Sub
Figure 8
Begin
Total=number1 + number2
DisplayTotal
End
Readnumber1,number2
Begin
Remainder = number mod 2
Display“Odd
number”
End
Readnumber
If remainder = 1Display“Even
number”
No
Yes
X Y
Figure 9
Case StudySMK Tun Uda’s Library needs a computerized registration program for their books registration process. As a librarian, you are given the responsibility by your library teacher to develop a program.
Kajian KesPerpustakaan SMK Tun Uda memerlukan program pendaftaran berkomputer untuk proses pendaftaran buku. Sebagai seorang Pustakawan , anda diberi tanggungjawab oleh Guru Perpustakaan untuk membina program tersebut.
a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.
Based on the pseudo code given, draw the suitable flow chart to show the flow of program.
Berdasarkan kod sumber yang diberi, lukis carta alir yang sesuai untuk menunjukkan aliran program [4 marks]
b. Describe one translation method used in above Coding Phase.Terangkan satu cara penterjemahan yang digunakan dalam Fasa Pengkodan di atas.
[3 marks]Source Yea
rLevel
Bloom
GOMBAK 2008
33. Every year the school will give dividends to its members. Irwan Shah is given the task to build a program to calculate it. He uses Microsoft Visual Basic programming language to complete his task.
Define programming language.[2 marks]
(a) Complete the flow chart below based on the pseudo code given
BEGINRequest member ic number, number of shareIf number of share >= 1ThenDividend = number of share x 5 %Print DividendElsePrint Error Message
83
Pseudo CodeBEGIN
Request book_tittle, author, publisher from userCheck input data
If any field empty Thenprint “ Please complete the data!”
Elseprint “Book registered!”
End IfEND
End IfEND
[4 marks]
32 Figure 17 (a) shows the program interface and the output of the program to find the result of an ICT mark. Figure 17 (b) shows part of the program code.
84
(a)
Private Sub cmdCheck_Click()Dim Mark As Integer
Mark = Val(txtMark.Text)If Mark >= 40 Then
MsgBox "Congratulation, you PASS the ICT test.", vbInformation, "Pass"Else
MsgBox "Sorry, you FAIL the ICT test.", vbInformation, "Fail" End IfEnd Sub
(b)
Figure 17
Based on Figure 1,
(a) create a flowchart [5 marks]
(b) complete the table below [2 marks]
Input Output
40
15
Source Year Level BloomSARAWAK (A) 2009
85
Source Year Level
Bloom
TERENGGANU 2009
32. The Smart Health Association (SHA) suggests that at most 30 percent of the calories in our diet comes from fat. This percentage can be calculated using the formula below:
You plan to develop a program that requests the name, number of calories per serving, and the grams of fat per serving as input, and determine whether the food meets the SHA recommendation. A sample output is as follows:
86
Draw a flowchart to show the program flow.
Source Year Level
Bloom
PCGHS 2009
33. Pasaraya Mesra want to held a year-end sale for it’s customers. 20% discounts were given for goods with the expiry date is before or on December 2009 while10% discount is for goods that expired after December 2009. As an IT consultant, you were asked to develop a program for that purpose.
Pasaraya Mesra mahu mengadakan jualan istimewa penghabisan tahun kepada pelangganpelangganya. Potongan sebanyak 20% akan diberikan kepada barangan yang tarikh luputnya sebelum atau pada disember 2009, manakala potongan 10% bagi barangan yang tarikh luputnya selepas disember 2009. Selaku jururunding IT, anda telah diminta membangunkan satu program komputer bagi tujuan tersebut.
a. State three input for the programNyatakan TIGA input bagi program tersebut
[3 marks]b. Draw a flow chart for the program.
Lukiskan carta alir bagi program tersebut .[4 marks]
Source Year Level
Bloom
PAHANG
2009
31. Diagram A and Diagram B show examples of control structure.Rajah a dan B menunjukkan contoh struktur kawalan
87
Based on Diagram A and Diagram B, answer the question below:
(a) Identify the types of control structures in Diagram A and Diagram B. [2 marks]Kenalpasti struktur kawalan pada Rajah A dan B
(b) Give two differences between control structures in Diagram A and Diagram B. [2 marks] Berikan dua perbezaan antara struktur kawalan pada Rajah A dan B
(c) Explain the phase where the diagrams are designed. [4 marks] Terangkan mengenai fasa yang berkait dengan Rajah di atas
Source Year Level
Bloom
WPKL 2009
Begin
Input date of birth, a
Request today’s date , b
Calculate age ( b - a)
Display age
End
Begin
Request student’s weight
print message “You are to heavy
to ride the toy car”
End
Weight>=60kg
print message “You can ride the toy car”
true
false
Diagram A Diagram B
88
32. The diagram shows the information on internet and intranet using flowchart.Rajah menunjukkan maklumat internet dan intranet menggunakan carta alir.
Figure 11 Rajah 11(a) Explain any two symbol of flowchart in Figure 11.
Terangkan mana-mana dua simbol yang terdapat di dalam Rajah 11.
(b) Explain the suitable statement for Y.Terangkan pernyataan yang sesuai bagi Y.
Source Year Level
Bloom
PERAK 2009
32 Figure 14 shows goods on sale in a shop.Rajah 14 menunjukkan barang-barang jualan murah di sebuah kedai.
89
Start
Read input =
“Internet”
End
X = An Internet is a public network which is worldwide collection of networks that links multiple field.X = Internet merupakan rangkaian umum di mana koleksi seluruh dunia dapat disambungkan dengan pelbagai bidang.
Start
Read input =
“Intranet”
End
Y
Display X Display Y
Figure 14 Rajah 14
Based on Figure 14, you are asked to develop a program to calculate the final I)i is c of each item.
Berdasarkan Rajah 14, anda dikehendaki membina satu program untuk menghitung harga muktamad setiap barang.
(a) (i) Identify two variables. Kenalpasti dua pemboleh ubah.
(ii) Justify your answer. Berikan justifikasi anda.
(b) Write the pseudo code for the program. Tulis kod pseudo untuk program itu.
Source Year Level
Bloom
SPM 2009
5.2.1.1 Describe the five main phases in program development: i. problem analysis, ii. program design, iii. coding, iv. testing and debugging and v. documentation
Section A
5. Table 2 shows the five main phases in program development.Jadual menunjukkan lima fasa utama dalam pembangunan aturcara.
90
Table 2Jadual 2
Match the phases with the following statement by writing A, B, C, D or E.Padankan fasa tersebut dengan penyataan berikut dengan menulis A, B, C, D atau E.i) Programmers identify the data input, process and output of the program.
Pengaturcara mengenalpasti data input, proses dan output bagi sesuatu program.ii) Programmer ensure the program runs correctly and is error free.
Pengaturcara memastikan program dijalankan dengan lancar dan tiada kesalahan.iii) The process of writing solution using a computer programming language.
Proses menyelesaikan masalah menggunakan bahasa pengaturcaraan komputer. i A
ii Ciii B
Source Year
Level
Bloom
TERENGGANU 2010
6. Table 5 shows the activities involved in the phases in program development.Jadual 5 menunjukkan aktiviti-aktiviti yang terlibat di dalam fasa pembangunan aturcara.
XTranslate pseudo code or flowcharts in programming language Menterjemah kod pseudo atau carta alir kepada bahasa pengaturcaraan
Y Identify input, output and processing requirementsMengenalpasti keperluan input, output dan pemprosesan.
Table 5Jadual 5
Based on Table 5, identify phase;Berdasarkan Jadual 5, kenalpasti fasa;(i) X(ii) YCoding Problem Analysis
Source Year
Level
Bloom
PUTRAJAYA 2010
3. Complete the following statements by filling in the blanks: Isikan ruang kosong untuk melengkapkan pernyataan berikut:
91
The process of detecting, locating and correcting logic errors is called _____.
Proses mengesan, mencari dan memperbaiki kesalahan logik disebut ______.TESTING AND DEBUGGING
Source Year
Level
Bloom
KELANTAN 2010
16. State the flow for developing program phases from the first to the last phase.Nyatakan aliran untuk fasa pembangunan aturcara bermula dari fasa yang pertama hingga ke yang fasa terakhir.
I. Coding phaseII. Documentation phaseIII. Program design phaseIV. Problem analysis phaseV. Testing and debugging phase
A. I II III IV VB. V III IV II IC. V I III II IVD. IV III I V II
Source Year
Level
Bloom
GOMBAK 2008
12. “In the Phase of Program Development, this phase is important for people who may be involved with
the program in the future.” This in this statement refer to ………………….. phase.
Source Year
Level
Bloom
PETALING PERDANA 2008
9. Table 2 shows task carried out during a program development phase.
Jadual 2 menunjukkan tugas-tugas yang dijalankan semasa fasa pembangunan atur cara.
SDraw user interface
Lukis antara muka pengguna
TProduce the user guide
Hasilkan panduan pengguna
UWrite program
Tulis atur cara
VIdentify input and output
Kenal pasti input dan output
WCheck for errors
Semak ralat
92Table 2 Jadual 2
Based on Table 2, select S, T, U, V or W for the following phases of the program development.
Berdasarkan Jadual 2, pilih S, T, U, V atau W bagi fasa berikut di dalam pembangunan program.
(i) Program Design
Reka bentuk Atur cara
(ii) Testing And Debugging
Pengujian dan Penyahpijatan
Source Year Level
Bloom
UNKNOWN
2009
i. Table 4 shows tasks carried out during a program development cycle.Jadual 4 menunjukkan tugas-tugas yang dijalankan semasa kitar pembangunan aturcara.
P Identify input and outputKenalpasti input dan output
Q Draw the flow of the programLukis aliran program
R Writing the coding using programming languageMenulis aturcara menggunakan bahasa pengaturcaraan
S Run the program and check for errors Uji lari program dan semak ralat
T Produce the user guideHasilkan panduan pengguna
Table 4 Jadual 4
Based on the Table 4, select P, Q, R, S or T for the following phases of the program development cycle.
Berdasarkan Jadual 4, pilih P, Q, R, S atau T bagi fasa berikut di dalam kitar pembangunan aturcara.
(i) Problem Analysis Analisis Masalah
(ii) Testing and Debugging Pengujian dan Penyahpijatan
Source Year Level
Bloom
KELANG 2009
20. FIGURE 7 shows the phases in program development.
93
FIGURE 7State
(i) Phase X(ii) Phase Y
Source Year Level
Bloom
PCGHS 2009
16. The second phase of program development is ____________. Where __________, which consists of short english phrases used to explain specific tasks within a program's algorithm may be used.
Fasa kedua dalam pembangunan program ialah____________. Dimana, _________yang mana mengandungi frasa bahasa inggeris yang ringkas bagi menerangkan tugas dalam algoritma program mungkin digunakan
Source Year Level
Bloom
PAHANG
2009
94
22. Match the correct answer between Table A and Table B.
Padankan jawapan yang betul di antara Jadual A dan Jadual B.
Table AJadual A
Table BJadual B
i Coding phase
Fasa pengkodan
A
The program will locate and
correct programming error.
Program tersebut akan
mengenalpasti dan
memperbetulkan ralat
pengaturcaraan.
ii Problem analysis
phase
Fasa analisis
masalah
B
A programmer uses a program
development tool to write a
code that translates the design
into a computer program.
Pengatucara menggunakan alat
pembangunan program untuk
menulis kod yang
menterjemahkan rekabentuk ke
dalam program komputer.
iii Program design
phase
Fasa rekabentuk
program
C
The programmer will identify the
data input, processes and
output for the program.
Pengaturcara akan
mengenalpasti input data,
proses dan output bagi
sesebuah program.
iv Testing and
debugging phase
Fasa pengujian dan
nyahpijat
D
A programmer must create a
flow chart and pseudocode.
Pengaturcara membina carta
alir dan kod pseudo.
Source Year Level
Bloom
PERLIS 200995
19. Figure 9 show program development phasesRajah 9 menunjukkan fasa pembangunan atur cara
Figure 9 Rajah 9
Phase 2 and 4 for the proper program development phase are :Fasa 2 dan 4 bagi fasa pembangunan atur cara yang teratur adalah :
i) Phase 2 : Fasa 2 :
ii) Phase 4 : Fasa 4 :
Source Year Level
Bloom
SPM 2007
18. Complete the following statements by filling in the blanks.Isikan ruang kosong untuk melengkapkan pernyataan berikut.
In the ………(i)…….. phase, a soluting is represented in the form of ………(ii)…….. flow chart and logic structure.Dalam fasa ………(i)…….., penyelesaian dinyatakan dalam bentuk ………(ii)…….., carta alir dan
struktur logik.
Source Year Level
Bloom
SPM 2008
20. State the first phase and third phase of program developmentNyatakan fasa pertama dan fasa ketiga pembangunan atur cara.
i)First phase Fasa pertama
ii) Third phase Fasa ketiga
Source Year Level
Bloom
SPM 2008
21. Table 2 shows tasks carried out during a program development cycle.Jadual 2 menunjukkan tugas-tugas yang dijalankan semasa kitar pembangunan atur cara.
P Write programTulis atur cara
Q Draw user interfaceLukis antara muka pengguna
96
1 Problem analysisAnalisis masalah
2
3 Coding Pengkodan
4
5 DocumentationDokumentasi
R Indentify input and outputKenal pasti input dan output
S Produce the user guideHasilkan panduan pengguna
T Check for errorsSemak ralatTable 2 Jadual 2
Based on Table 2, select P, Q, R, S or T for the following phases of the program development cycle :Berdasarkan Jadual 2, pilih P, Q, R, S atau T bagi fasa berikut di dalam kitar pembangunan atur cara :
I) Problem analysis Analisis masalahII) Documentation Dokumentasi
Section B
1. Figure 1 shows the phases in program development.Rajah 1 menunjukkan fasa pembangunan aturcara.
a. Name phase X and phase Y.
Namakan fasa X dan fasa Y.b. State one tool that is used during phase X.
Nyatakan satu alat yang digunakan semasa fasa X.c.
Give the importance of the statement Z in the source code above. (1 Mark )Berikan satu kepentingan Pernyataan Z dalam kod sumber di atas.
a. Phase X - Program Design PhasePhase Y - Implementation Phase
b. Tool Used – Flow Chart. Top-down design, pseudo code ( any one )
c. Statement Z- To tell the programmer about the following functions in use..- Internal comments within program. It explain the purpose of the code statement within
the program.- This statements mostly address to other programmers who may have to make
corrections or modification to the programs.( any one of the above )
Source Year
Level
Bloom
PERLIS 20197
0
29 Figure 5 shows part of a programming language for application Z.
a) Explain the first phase to develop application software application. [2 mark]b) A is an internal documentation for application Z. Explain the importance of A in application development phase.
[2 mark]Source Yea
rLevel
Bloom
KELANTAN 2008
29 Figure 8(a) and 8(b) show activities in two program development phases.Rajah 8(a) dan 8(b) menunjukkan aktiviti-aktiviti dalam dua fasa pembangunan aturcara.
FIGURE 8(a) FIGURE 8(b)RAJAH 8(a) RAJAH 8(b)
a). Name Phase A and state one tool used in the phase. [2 marks]
Namakan fasa A dan nyatakan satu alat yang digunakan dalam fasa ini.
[2 markah]
d). Name Phase B and state another activity in the phase. [2 marks]
Namakan fasa B dan nyatakan satu lagi aktiviti dalam fasa ini. [2 markah]
Source Year Level Bloom
98
Phase A
Review and define the problem. Identify data input, process and
output.
Kaji dan takrif masalah. Kenalpasti data input, proses
dan output.
Phase B
Compile the program. Test the program with
relevant data.
Kompil aturcara Uji aturcara dengan data
yang sesuai.
A
Figure 5
KL 2008
29. Table 02 shown five main phases in program development.Jadual 02 menunjukkan lima fasa utama dalam pembangunan program
Situation/Situasi Phases/FasaInterview client to find out his / her needs.
Temuramah untuk mencari kehendak pelanggan D
E Coding phase/Fasa pengekodan
User manual, output records and program listing.Menyediakan manual penggunamengeluarkan
semua data dan senarai programF
G
Testing and debugging phase
Fasa pengujian dan penyahpijatan
Design a flow chart that represents the needs of the client.
Melukis carta alir yang menunjukkan keperluan pelanggan
Program design phaseFasa reka bentuk
Table 02
Based on table 02,
(a) Name phase D and F.Namakan fasa D dan F
(b) State the situation of E and G.Nyatakan situasi fasa E dan G
Source Year Level
Bloom
WPKL 2009
30.
PROBLEM ANALYSIS
PROGRAM DESIGN
X
Y
DOCUMENTATION
99
Figure 8 Rajah 8
Figure 8 shows the five main phases of program development.
Rajah 8 menunjukkan lima fasa dalam pembangunan program.
a) Refer to Figure 8, what is X and Y? [2 marks]
Merujuk kepada Rajah 9, apakah X dan Y?
b] State TWO types of errors in phase Y. [2 marks]
Nyatakan DUA jenis ralat pada fasa Y.
Source Year Level
Bloom
PERLIS 2009
Section C
32. Figure 15 shows the five main phases in program development.Rajah 15 menunjukkan lima fasa dalam pembangunan aturcara.
FIGURE 15 RAJAH 15
(a) Give TWO consequences if phase N is not done.[3 marks]
Berikan DUA akibat yang akan berlaku sekiranya Fasa P tidak selesaikan.[3 markah]
(b) Phase P is one of the phases in a program development. Explain the activities involved in that phase.
[4 marks]100
Phase M:Fasa M:o Identify
problemKenalpasti masalah
o Identify inputKenalpasti
Phase N: Fasa N:DocumentationDokumentation
Phase O: Fasa O:
Private Sub cmdDisplay_Click() If Val(txtchange.text)>=100 then
lblOutput.Caption=”Your change:” & _ Int (txtchange.text/100) & “Ringgit”
ElselblOutput.Caption=”Your change:” & _
txtchange.text & “cents”End if
End Sub
Phase P: Fasa P:
Fasa P terdapat dalam fasa-fasa pembangunan program. Terangkan aktiviti-aktiviti yang terdapat dalam fasa tersebut.
[4 markah]Source Yea
rLevel
Bloom
PERAK 2008
Question 1Soalan 1
Quick Start is a direct selling company that provides healthy supplement and domestic products. Ahmad is
asked to develop a program to calculate monthly bonus for the staff who obtain high performance in their
direct selling.
Quick Start ialah syarikat jualan langsung yang menyediakan produk kesihatan dan domestik. Ahmad
diminta membangunkan aturcara untuk mengira bonus bulanan kakitangan yang memperoleh prestasi
tinggi dalam jualan langsung mereka.
The diagram below shows the phases that Ahmad goes through during program development.
Rajah di bawah menunjukkan fasa-fasa yang Ahmad perlu lalui semasa pembangunan aturcara.
Based on the diagram above,
101
Phase AAhmad interviews Pn. Aminah , the manager of the company to get detail information about the system that will be developed.
Ahmad menemubual Pn. Aminah, pengurus syarikat untuk mendapatkan maklumat terperinci mengenai sistem yang akan dibangunkan
Phase BUse a programming language to code a program. Then he uses a translator to translate source code line by line and execute it.
Menggunakan bahasa pengaturcaraan untuk menulis aturcara. Kemudian beliau menggunakan penterjemah yang menterjemah kod sumber (aturcara) baris demi baris dan melaksanakannya.
Phase CAhmad detects and corrects errors.
Ahmad mengesan dan membetulkan ralat.
Phase DAhmad makes notes through out the program development process and user manual is produced.
Ahmad membuat nota sepanjang proses pembangunan aturcara seterusnya menghasilkan manual pengguna.
Berdasarkan rajah di atas,
a) State the omitted phase that is not done by Ahmad. Briefly explain the omitted phase.
Nyatakan fasa yang tidak dijalankan oleh Ahmad. Secara ringkas terangkan fasa tersebut.
(2M)
b) State another translation method that can be used to translate the program into machine
language in Phase B. Describe the method briefly.
Nyatakan kaedah penterjemah yang boleh digunakan untuk menterjemah aturcara tersebut
kepada bahasa mesin dalam Fasa B. Terangkan kaedah tersebut secara ringkas.
(3M)
c) List TWO importance of Phase D in program development.
Senaraikan DUA kepentingan Fasa D dalam pembangunan aturcara. (2M)
Source Year Level
Bloom
PERLIS 2008
5.2.2.1 Apply program development phases to solve problems.
Section A
1. Which of the following are done during the documentation phase in program development phase?A. Johan interviews his client to find out the client needs.B. Johan writes a report that consists of all the descriptions of the program, source code and
maintenances.C. Johan test the program for any error.D. Johan corrects the program source code
Manakah daripada yang berikut ini dilakukan semasa fasa dokumentasi dalam tahap program pembangunan? A. Johan wawancara kliennya untuk mengetahui keperluan pelanggan.B. Johan menulis sebuah laporan yang terdiri daripada semua keterangan daripada kod, program sumber dan penyelenggaraan.C. Johan menguji program untuk kesalahan apapun.D. Johan membetulkan kod sumber programB
Source Year
Level
Bloom
SABAH 2010
19. The following are the activities that are carried out during program development.
I. Send the report that includes charts, solution algorithm, test data and program code to system analyst.
II. Draw an input, process and output chart.III. Prepare a graphical or written description of the steps to solve the problem.IV. Correct the codes that violate the syntax of the programming language.V. Meets the users to understand the purpose of the requirements.VI. Code the program using a programming language.
Arrange the activities involved in the correct order.
102
Source Year
Level
Bloom
PENANG 2008
19. Figure 7 shows a coding to calculate the area of a rectangle. Complete the following statements by filling in the blank.
Rajah 7 menunjukkan pengekodan untuk mengira luas bagi segiempat. Isikan ruang kosong untuk melengkapkan pernyataan berikut.
Source Year Level
Bloom
PUTRAJAYA 2009
The Dim statement declares the name of the ……………………………….…… Pernyataan Dim mengisytiharkan nama bagi ……………………………………
17 The following are activities carried out during program development.
Berikut merupakan aktiviti-aktiviti yang dijalankan semasa pembangunan atur cara.
I Code the program using a programming language
II Meets users to understand the purpose and the requirements.
III Test the program and make sure it is error free
IV Prepare a flowcart or pseudocode to solve the problem.
Arrange the above activities in the correct order.
Susun aktiviti-aktiviti tersebut megikut turutan yang betul.
Source Year Level
Bloom
N.SEMBILA 2009
103
Figure 7Rajah 7
N
Question 24 is in statement form. Write True or False for the following statements: Soalan 24 adalah dalam bentuk pernyataan. Tuliskan Benar atau Palsu untuk pernyataan tersebut.
24. A programmer uses flowcharts to code a program.Pengatur cara menggunakan carta alir untuk mengekod aturcara.
Source Year Level
Bloom
SPM 2007
Section B
30.
Based on Figure 16 :Berdasarkan Rajah 16 :
a) Draw a suitable input interface for the project stated in Figure 16. [2 marks]
Lakarkan satu antaramuka input yang bersesuaian untuk projek yang dinyatakan dalam Rajah 16.
b) Identify two basic elements that are required in the programming which are going to be developed as stated in Figure 16.
Kenalpasti dua elemen asas yang diperlukan dalam pengaturcaraan yang akan di bina seperti dinyatakan dalam Rajah 16.
Source Year Level
Bloom
UNKNOWN
2009
30. Based on Statement 1 below, answer the following question.Berdasarkan Penyataan 1 di bawah, jawab soalan-soalan berikut.
104
Pewaja Land Company needs a program to calculate the area of land. You are asked to prepare a details report and user manual for the program.
Syarikat Tanah Pewaja memerlukan sebuah program untuk mengira keluasan tanah. Anda diminta untuk menyediakan laporan dan panduan pengguna bagi program tersebut.
You are a form 5 student who have registered for an ICT subject. You are required to develop a programming project. The programming project which you need to produce is to calculate the area of a rectangle.
Anda seorang pelajar tingkatan 5 yang mendaftar untuk subjek ICT. Anda perlu menghasilkan satu projek pengaturcaraan. Projek pengaturcaraan yang perlu dihasilkan ialah satu atur cara bagi mencari luas segiempat tepat.
Figure 16 Rajah 16
Statement 1 Penyataan 1
(i) State the phase involve for situation in Statement 1 and give ONE advantage of that phase.Nyatakan fasa yang terlibat bagi situasi Pernyataan 1 dan beri SATU kelebihan fasa berkenaan.
[2 marks](ii) State the input item and output item for the program that have been developed.
Nyatakan item input dan item output yang terkandung dalam program yang telah dibangunkan.
[2 marks]Source Year Lev
elBloom
KELANG 2009
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.
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.-identify input/output/data component/processing-interview client to find out their needs-problem checklist-software to use
105
(any suitable answer) (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?Coding error(ii) Justify your answer. / Berikan justifikasi anda.Refer to answer given
Source Year
Level
Bloom
SPM 2010
2. You are asked to develop a program to calculate the area of a circle. The program shouldallow the user to key in the input and display the output.Anda dikehendaki membangunkan sebuah atur cara untuk mengira keluasan sebuah bulatan.Atur cara tersebut membenarkan pengguna memasukkan data dan memaparkan keputusanpengiraan.
(a) Draw a flowchart for the program. / Lukis carta alir bagi aturcara tersebut. (b) i) State a constant and a variable to be used.
Nyatakan pemalar dan pembolehubah yang akan digunakan.ii) Write down the fomula of the calculation.
Tuliskan formula bagi pengiraan keluasan bulatan
(a)
(c) i) Constant = Pi = = 3.14Variable = r (radius/jejari)
ii) Area of A Circle = Pi * r * r @= 3.14 * r * r @= * r * r
Source Year
Level
Bloom
N. SEMBILAN 2010
33 The following is a text about a programming project
Berikut adalah teks tentang satu projek pengaturcaraan.
106
Rozie is a form 5 Alfa student who took ICT subject. She needs to complete a programming project. The project which needs to be completed was to produce one program to find the average of three numbers.
Rozie seorang pelajar tingkatan 5Alfa yang mengambil subjek ICT . Beliau perlu menyiapkan satu projek pengaturcaraan. Projek yang perlu dihasilkan ialah satu aturcara mencari purata bagi tiga nombor.
Figure 11 shows a flowchart for the program which will be developed by Rozie.
Rajah 11 menunjukkan carta alir bagi aturcara yang akan dihasilkan oleh Rozie.
Based on the text :
Berdasarkan teks di atas :
(a) Write Input, Process and Output to completed the Figure 11.
Tuliskan Input,Proses dan Output untuk melengkapkan Rajah 11.
State another tool other than in Figure 11 in Program Design Phase.
Nyatakan satu lagi alat selain dari rajah 11 yang boleh digunakan dalam Fasa Rekabentuk Aturcara.
(b) Rozie used Visual Basic software to write a program to complete a project. In which phase that activity is implemented. Explain the phase.
Rozie menggunakan perisian Visual Basic untuk menulis aturcara bagi menyiapkan projek tersebut. Dalam fasa manakah aktiviti tersebut dilaksanakan. Terangkan fasa tersebut.
Source Year Lev Bloom
Start
Input: ………
Output: ……..
End
Process: …………….
107
Figure 11 Rajah 11
elKELANTA
N2009
4. Figure 13 (a) is the source code while 13(b) is the flow chart for the ICT Result program.Rajah 13 (a) adalah kod sumber manakala 13 (b) merupakan carta alir bagi program markah ICT
Private Sub CommandCheck_Click()Dim marks As Double, response As String
marks = TextMark.Text
If (marks >= 50) Thenresponse = MsgBox(“You have pass your ICT examination”, vbOKOnly, “Pass”)
Elseresponse = MsgBox(“You have fail your ICT examination”, vbOKOnly, “Fail”)
End If
Figure13(a)
Figure 13 (b)
Based on Figure 13(a) and 13(b), answer the following questions:Berdasarkan rajah 13 (a) dan 13 (b), jawab soalan-soalan berikut;
i. States which phase comes after the process in Figure 13(a).Nyatakan fasa yang terlibat selepas proses dalam rajah 13(a)Coding phase
ii. Design the output interface for both of the outcomes.Rekabentuk output antaramuka bagi kedua-dua hasil
Begin
>= 50?
Request marks
Print “You have fail your ICT examination.”
End
Print “You have pass your ICT examination.”
No
Yes
108
Source Year
Level
Bloom
SABAH 2010
109
33
Based on Figure 4,
a) State the constant value from the above flow chart. [ 1 marks ]
b) Explain TWO differences between constant value and variable value. [ 4 marks ]
c) Explain the control structure used in Figure 1. [ 2 marks ]
Source Year
Level
Bloom
PAHANG 2008
110
Begin
Get radius
Print AreaOf circle
Area of circle =½ * PI * Radius ^2
End
Figure 4Rajah 4
Source Year Level BloomSARAWAK
(A)2008
31. Figure 10 contains statements explaining the programming project for ICT students.
Rajah 10 mengandungi pernyataan yang menerangkan projek pengaturcaraan untuk pelajar ICT .
As an ICT student, you are required to develop a program to calculate the volume of cuboids using Visual Basic software. The program should allow the users to input the items needed to calculate the volume of cuboids and then display the output.
Sebagai pelajar ICT, anda dikehendaki membangunkan satu program untuk mengira isipadu kuboid menggunakan perisian Visual Basic. Program tersebut hendaklah membenarkan pengguna memasukkan item input yang diperlukan untuk mengira isipadu kuboid dan memaparkan output.
Figure 10 Rajah 10
Based on the above statements in Figure 10 :Berdasarkan pernyataan di rajah 10 :
a) Design an input interface for the program. Your design should includeAll the input items required to develop the program as in the statements.
Hasilkan rekabentuk antaramuka input bagi program tersebut. Rekabentuk anda
111
hendaklah merangkumi item input yang diperlukan untuk membangunkan program
seperti di dalam kenyataan di atas.
b) Figure 11 shows a programming coding to calculate the Volume of a Cylinder using Visual Basic software.Rajah 11 menunjukkan kod aturcara untuk mengira isipadu silinder menggunakan perisian Visual Basic.
Private Sub Command1_Click() Dim radius As Integer Dim height As Integer Const C As Double = 22 / 7 radius = A A = Text1.Text height = B B = Text2.Text Volume = C * A * A * B Text3.Text = VolumeEnd Sub
Figure 11 Rajah 11Based on Figure 11 :Berdasarkan Rajah 11 :
(i) Identify oneKenalpasti satu
Variable :Pembolehubah :
Constant. :Pemalar :
(ii) State the difference for the answers in ( b i ).Nyatakan perbezaan bagi jawapan di ( b i ).
Source Year Level
Bloom
JOHOR 2009
31. Amin is required to write a program to calculate the volume of a pyramid by using the formula, volume = 1/3 x length x width x height. The program should allow the user to key in the length, width and height of the pyramid, and display the volume of the pyramid.
Amin dikehendaki menulis sebuah program untuk mengira isipadu sebuah piramid dengan menggunakan formula berikut, Isipadu = 1/3 x panjang x lebar x tinggi. Program ini membenarkan pengguna memasukkan nilai panjang, lebar dan tinggi sebuah piramid dan memaparkan nilai isipadu sebuah piramid.
a) Draw and label a suitable user interface design for input and output of the program with sample data. [4 marks]Lukis dan labelkan rekabentuk antaramuka input dan output yang sesuai untuk program tersebut beserta dengan contoh data.
112
b) Draw a flow chart to show the design of the program. [3 marks]Lukis carta alir untuk menunjuk rekabentuk program tersebut.
Source Year Level
Bloom
KEDAH 2009
33. Statement 3 shows a problem statement which is to be written in MS Visual Basic 6.0.
Pernyataan 3 menunjukkan satu pernyataan masalah yang akan ditulis dalam MS Visual Basic 6.0.
STATEMENT 3 PERNYATAAN 3
c) Draw a user interface of the program. [3 marks]
Lukis antaramuka pengguna bagi aturcara ini. [3 markah]
d) State a constant and a variable to be used. Give reasons to your answer. [4 marks]
Nyatakan satu pemalar dan satu pembolehubah yang akan digunakan. Berikan alasan kepada
jawapan anda. [4 markah]
Source Year Level
Bloom
UNKNOWN
33. The following statement explains the operation of a taxi company.Pernyataan berikut menerangkan tentang operasi sebuah syarikat teksi.
113
Smart Cab is a taxi company operating in Seri Wangi Mall. The company is going to use computers for its coupon system.
The coupon should display the following data items : Receipt number (auto generated) Cashier’s name Date Fare
Smart Cab ialah sebuah syarikat teksi yang beroperasi di Seri Wangi Mall. Syarikat tersebut akan menggunakan komputer untuk sistem kuponnya.
Kupon tersebut mestilah memaparkan item data berikut: Nombor resit (dijana secara automatik) Nama juruwang Tarikh Tambang
This program calculates the price of an item after a 10% discount. The user will key in the price of the item. The program will calculate and display the price after discount..
Aturcara ini mengira harga barangan selepas diskaun 10%. Pengguna akan masukkan harga barangan. Aturcara akan mengira dan memaparkan harga selepas diskaun.
Based on the above statements : Berdasarkan penyataan itu :
a) State the data type for the first three data items required for the coupon systemNyatakan jenis data untuk tiga item data pertama yang diperlukan untuk system kupon itu.
b) Using the information and data given in the statement, create the output of the coupun that will be used by the taxi company.Dengan menggunakan maklumat dan data di dalam pernyataan, hasilkan kupon yang akan digunakan untuk syarikat teksi itu.
Source Year Level
Bloom
SPM 2008
114