Navigasi Materi

Scratch (materi 7)

Scratch Materi 7 - Conditional Statements

🐱 Scratch Materi 7

Conditional Statements

Percabangan dan Pengambilan Keputusan

Making Decisions with Code

🎯 Tujuan Pembelajaran / Learning Objectives

🔎 Condition

🇮🇩 Siswa memahami apa yang dimaksud dengan kondisi.

🇬🇧 Students understand what a condition is.

↪️ If Then

🇮🇩 Siswa dapat menggunakan if then.

🇬🇧 Students can use if then.

🔀 If Else

🇮🇩 Siswa dapat membuat program dengan dua kemungkinan.

🇬🇧 Students can create programs with two possible outcomes.

📚 Apa itu Conditional Statement?

🇮🇩 Dalam kehidupan sehari-hari kita sering membuat keputusan berdasarkan suatu kondisi.

Contoh:

Jika hujan, maka saya membawa payung.

Dalam programming, kita dapat menuliskan ide yang sama menggunakan if ... then.

🇬🇧 In programming, we can express the same idea using if ... then.

when green flag clicked
if <condition> then
say Bring an umbrella!

🔎 Condition

Condition adalah sesuatu yang dapat bernilai true atau false.

A condition can be either true or false.

TRUE ✅

The condition is correct.

Program menjalankan perintah.

FALSE ❌

The condition is not correct.

Program tidak menjalankan perintah di dalam if.

↪️ If Then

Struktur dasar:

if <condition> then
say Hello!

Artinya:

Jika condition benar, lakukan perintah.
If the condition is true, execute the command.

🔀 If Then Else

Kadang-kadang kita membutuhkan dua kemungkinan.

🇬🇧 Sometimes we need two possible outcomes.

if <condition> then
say Yes!
else
say No!

Jadi:

TRUE : first action   |   FALSE : second action

🧮 Comparison Operators

Condition sering dibuat menggunakan comparison operators.

>
greater than
lebih besar dari
<
less than
lebih kecil dari
=
equal to
sama dengan
if <(score) > 70> then
say Great!

🧩 Scratch Vocabulary

Condition
Kondisi yang dapat bernilai true atau false.
If
Jika.
Then
Maka / lakukan.
Else
Jika tidak.
True
Benar.
False
Salah / tidak terpenuhi.

🖱️ Practice Area — Make a Decision!

🇮🇩 Coba ubah kondisi dan lihat bagaimana Sprite mengambil keputusan.

🇬🇧 Change the condition and see how the Sprite makes a decision.

🎚️ Score

Condition

if score >= 70 then

Choose a score.
Practice Stage
score
-
🐱
Waiting...

⭐ Challenges — Build Your Conditional Program!

Drag & Drop : Script Area : Run : Stage : Check

⭐ Challenge 1 — Simple If

🇮🇩 Buat Sprite mengatakan Great! jika score lebih besar dari 70.

🇬🇧 Make the Sprite say Great! if the score is greater than 70.

🧱 Block Library
when green flag clicked
set score to 80
if score > 70 then
say Great!
📝 Script Area
Drag blocks here
Build your script.
🎬 Stage — Condition
Challenge 1
score
-
🐱
Waiting for script...

⭐ Challenge 2 — Change the Condition

🇮🇩 Buat program yang mengatakan Keep Trying! jika score tidak lebih dari 70.

🇬🇧 Make the program say Keep Trying! if the score is not greater than 70.

🧱 Block Library
when green flag clicked
set score to 50
if score <= 70 then
say Keep Trying!
📝 Script Area
Drag blocks here
Build your script.
🎬 Stage — True / False
Challenge 2
score
-
🐱
Waiting for script...

⭐⭐ Challenge 3 — If Then Else

🇮🇩 Buat Sprite mengatakan Great! jika score ≥ 70, dan Keep Trying! jika tidak.

🇬🇧 Make the Sprite say Great! if score ≥ 70, and Keep Trying! otherwise.

🧱 Block Library
when green flag clicked
set score to 80
if score >= 70 then else
say Great!
say Keep Trying!
📝 Script Area
Drag blocks here
Build your if else program.
🎬 Stage — Two Possible Outputs
Challenge 3
score
-
🐱
Waiting for script...

⭐⭐ Challenge 4 — Mini Decision Program

🇮🇩 Buat program keputusan sederhana: jika score ≥ 75, Sprite mengatakan "Excellent!". Jika tidak, Sprite mengatakan "Keep Practicing!".

🇬🇧 Create a simple decision program: if score ≥ 75, the Sprite says "Excellent!". Otherwise, the Sprite says "Keep Practicing!".

🧱 Block Library
when green flag clicked
set score to 90
if score >= 75 then else
say Excellent!
say Keep Practicing!
📝 Script Area
Drag blocks here
Build your mini decision program.
🎮 Stage — Decision Program
Challenge 4
score
-
🐱
Waiting for script...

💭 Reflection / Refleksi

Centang pernyataan yang sudah dapat kamu lakukan.
Check the statements you can already do.

📝 Mini Quiz

1. Apa yang dimaksud dengan condition?
What is a condition?
2. Apa yang dilakukan if then?
What does if then do?
3. Apa fungsi else?
What is the purpose of else?
4. Jika score = 80, apakah kondisi score > 70 true?
If score = 80, is score > 70 true?
5. Operator > berarti...
What does > mean?

🚀 Next Lesson

Materi 8 — Loops / Repetition

🇮🇩 Kita akan belajar membuat Sprite mengulang perintah menggunakan repeat dan forever.

🇬🇧 We will learn how to repeat commands using repeat and forever.