# Programming

Document Sample

```					1.   Programming Concept
2.   Algorithm (Sequential)
3.   Algorithm (Selection – IF)
4.   Flowchart (Sequential)
5.   Flowchart (Selection – IF)

1/3
ICTL

Analisis                Penyelesaiaan terperinci

Pengaturcaraan
Penyelesaiaan Am

Algorithm
Ujian

Semakan
Senggaraan

Fasa Penyelesaian Masalah   Fasa Implementasi

2/3
•Sebelum memahami algorithm perlu faham dulu konsep
programming dengan memahami beberapa istilah.
•program
•programming
•programmer

•Terdapat 2 jenis algorithm :
•Sequential
•Selection

•Algorithm mempunyai pewakilan atau dikenali sebagai
pewakilan algorithm :
1.Psuedocode
2.Flowchart

• Selain pseducode dan flowchart anda juga perlu tahu
tentang sourcecode.

3/3
ICTL

problem

How to solve
problem

People who solve
the problem

1/9
ICTL

Untuk mengadakan satu atucara, kita memerlukan seorang
pengaturcara untuk membuat pengaturcaraan.

Untuk membangunkan satu program, kita memerlukan seorang
programmer untuk membuat programming.

Sekolah kita akan menyambut hari guru, oleh itu kita
memerlukan seorang guru untuk membuat persediaan.

2/9
ICTL

•General – a set / list of instructions to follow

•Computer – a set / list of instructions to
direct the computer to do a task

•Creating
•A sequence                  Creating a sequence of instructions to enable the
•Instructions                Computer to do something(activity or act).

•Enable/direct computer

3/9
ICTL

Click on instructions

Example of daily life

Batrisyia wakes up at 6.00am everyday. Then, she will
brush her teeth cleanly. Next, she will take a bath. Once
done, Batrisyia will put on her school uniform. She will
have her breakfast right after that. After a nice and
fulfilling breakfast, she will make her way to school.

4/9
ICTL

Example of daily life

6.00 am           -     wake up
6.15 am           -     brush teeth
6.20 am           -     take a bath
6.30 am           -     wear school uniform
6.45 am           -     have a breakfast
7.00 am           -     go to school

5/9
ICTL

•   List some example of   •Write list of instructions of one of the
programs               programs

Problem: A Birthday Party
   Making Coffee          How to solve:
   Baking a Cake
   Birthday Party         1.Arrival of guest and friends
   Go to school           2.Welcome speech
   Clean a Classroom      3.Cutting the birthday cake
   Post a letter          4.Lucky draw and games
   Cooking Rice
   Wuduk
   Solat

6/9
ICTL

Program:
How to solve:
1.Get a sweets
2.Unwrap the sweets
3.Put the sweets into your mouth

1.What are the instructions tell you to do?

2.How many instructions are there in this program?

7/9
ICTL

A Set/List of Instructions
   Wash and cut the tomatoes and lettuce
   Add some salt, pepper, olive oil and lemon
juice
   Cut the apple, cucumber and carrots into
cubes
   Wash and peel the apple, cucumber and
carrot
   Toss the ingredients before serving
   Put all the ingredients in the salad bowl

1. Wash and peel the apple, cucumber and carrot
2. Cut the apple, cucumber and carrots into cubes
3. Wash and cut the tomatoes and lettuce
4. Put all the ingredients in the salad bowl
5. Add some salt, pepper, olive oil and lemon juice
6. Toss the ingredients before serving                                 8/9
ICTL

A Set/List of Instructions
   Wash and cut the tomatoes and lettuce
   Add some salt, pepper, olive oil and lemon
juice
   Cut the apple, cucumber and carrots into
cubes
   Wash and peel the apple, cucumber and
carrot
   Toss the ingredients before serving
   Put all the ingredients in the salad bowl

Programming (Creating a sequence of instructions )

1.   Wash and peel the apple, cucumber and carrot
2.   Cut the apple, cucumber and carrots into cubes
3.   Wash and cut the tomatoes and lettuce
4.   Put all the ingredients in the salad bowl
5.   Add some salt, pepper, olive oil and lemon juice
6.   Toss the ingredients before serving
9/9
ICTL

Analisis                Penyelesaiaan terperinci

Pengaturcaraan
Penyelesaiaan Am

Algorithm
Ujian

Semakan
Senggaraan

Fasa Penyelesaian Masalah   Fasa Implementasi

2/3
ICTL

   A specific
   and step-by-step set of instructions
   for carrying out a procedure or solving a problem,
   usually with the requirement that the procedure
terminate at some point

   2 types of algorithm representation will be explained:
◦    Flowchart
◦    Pseudocode

1/4
ICTL

•A method
•Procedure
•recipe

•Satu jujukan langkah demi langkah terhingga
•Digunakan untuk menyelesaikan masalah

Seorang pengaturcara yang baik biasanya tidak cuba
menyelesaikan masalah dengan terperinci di peringkat
permulaan. Biasanya kaedah rekabentuk atas-bawah
digunakan.                                             1/4
ICTL

Problem: Prepare a Breakfast
1. Start
2. Prepare a Breakfast
3. End

1/4
ICTL

Problem: Prepare a Breakfast
1. Start
2. Prepare a Breakfast
2.1 Prepare a tuna sandwich
2.2 Prepare some chips
2.3 Make a cup of coffee
3. End

1/4
ICTL

Problem: Prepare a Breakfast
1. Start
2. Prepare a Breakfast
2.1 Prepare a tuna sandwich
2.1.1 Take 2 slices of bread
2.1.2 Prepare tuna paste
2.2 Prepare some chips
2.2.1 Cut potatoes into slices
2.2.2 Fry the potatoes
2.3 Make a cup of coffee
3. End

1/4
ICTL

1/4
ICTL

1. Student identify at least five daily activities that involve
sequence or procedure.
• Student list down the procedures accordingly to its order.

1/4

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 14 posted: 4/5/2012 language: Latin pages: 20
How are you planning on using Docstoc?