Class 8 Computer Science Chapter 6 Complete Guide Book — Programming with Scratch | PunjabTest.com

Class 8 Computer Science Chapter 6 Complete Guide Book — Programming with Scratch | PunjabTest.com

PunjabTest.com > Class 8 > Computer Science — all chapters > Chapter 6: Programming with Scratch

اس chapter میں topics (Topics in this chapter)

  1. 1. What Is Scratch? — اسکریچ کیا ہے؟
  2. 2. Scratch and Programming Concepts — اسکریچ اور پروگرامنگ کے تصورات
  3. 3. Loops, Nesting, Functions and Cloning — لوپس، نیسٹنگ، فنکشنز اور کلوننگ
  4. 4. Building and Debugging a Scratch Project — اسکریچ منصوبہ بنانا اور خرابی دور کرنا
  5. 📝 Exercise Questions — with Answers
  6. 📌 Chapter Summary & Guidance
SOURCE NOTE

SLO-based practice chapter: no clean official PCTB book PDF for Class 8 Computer Science was available at build time, so this chapter is built from the PCTB/SNC Student Learning Outcomes (SLOs) for Class 8 Computer Science. It is practice material for the curriculum topics — NOT the official book exercise. When the official book is obtained, its exercise will replace this practice set. Nothing here is presented as a book page or an official question.

Chapter titles follow the PCTB/SNC curriculum progression for this class. All questions and answers below are original practice material written for this guide.

1. What Is Scratch?اسکریچ کیا ہے؟
🏷 Tags: Scratch, blocks, sprite, stage
ENGLISH

Scratch is a visual programming language: instead of typing code, you drag and drop blocks that snap together like puzzle pieces. A sprite is a character or object on the stage, and blocks tell it what to do.

Scratch removes typing errors — a block either fits or it does not — so beginners can focus on logic: sequence, selection and loops, the same ideas as in any language.

اردو

اسکریچ ایک بصری پروگرامنگ زبان ہے: کوڈ ٹائپ کرنے کے بجائے آپ بلاکس کو گھسیٹ کر جوڑتے ہیں جیسے پزل کے ٹکڑے۔ اسپرائٹ اسٹیج پر کردار یا چیز ہے اور بلاکس اسے بتاتے ہیں کہ کیا کرنا ہے۔ اسکریچ میں ٹائپنگ کی غلطیاں ختم ہو جاتی ہیں — بلاک یا تو جڑتا ہے یا نہیں — اس لیے نئے سیکھنے والے منطق پر توجہ دے سکتے ہیں۔

What Is Scratch?Blocks→Sprite→Stage→Snap TogetherPunjabTest.com • diagram بنایا گیا ہے, کتاب کی تصویر نہیں
Scratch samjho: block ghaseeto, joro — typing ki ghalti khatam, mantaq par tawajjo.
2. Scratch and Programming Conceptsاسکریچ اور پروگرامنگ کے تصورات
🏷 Tags: loops, conditions, variables, events
ENGLISH

Scratch blocks map directly onto programming concepts: motion blocks move a sprite, looks blocks change its appearance, control blocks give loops (repeat) and conditions (if), sensing blocks react to keys or touches, and variables store numbers like a score.

An event block starts a script — 'when green flag clicked' or 'when space key pressed'. Every program is: when something happens, do these steps.

اردو

اسکریچ بلاکس براہ راست پروگرامنگ تصورات سے ملتے ہیں: موشن بلاکس اسپرائٹ کو حرکت دیتے ہیں، لکس بلاکس شکل بدلتے ہیں، کنٹرول بلاکس لوپ اور شرائط دیتے ہیں، سینسنگ بلاکس کیز یا چھونے پر ردعمل دیتے ہیں اور ویری ایبلز اسکور جیسے اعداد محفوظ کرتے ہیں۔ ایونٹ بلاک اسکرپٹ شروع کرتا ہے — جیسے سبز جھنڈا دبانے یا اسپیس کی دبانے پر۔ ہر پروگرام یہی ہے: جب کچھ ہو تو یہ مراحل کرو۔

Scratch and Programming ConceptsMotion→Control(loop/if)→Sensing→VariablesPunjabTest.com • diagram بنایا گیا ہے, کتاب کی تصویر نہیں
Scratch blocks samjho: event شروع کرتا ہے, control loop اور شرط دیتا ہے, variable score رکھتا ہے.
3. Loops, Nesting, Functions and Cloningلوپس، نیسٹنگ، فنکشنز اور کلوننگ
🏷 Tags: nested loops, custom blocks, clone
ENGLISH

A loop inside another loop is a nested loop — for example, repeat 4 times: draw a side, turn 90 degrees, and inside that, repeat a pattern. Nesting builds complex behaviour from simple repeats.

Custom blocks (Scratch's functions) bundle steps under one name — 'draw square' — so they can be reused. Cloning creates copies of a sprite at run time, for example many falling apples in a game, each acting independently.

اردو

لوپ کے اندر لوپ نیسٹڈ لوپ ہے — مثلاً 4 بار دہراؤ: ایک ضلع بناؤ، 90 ڈگری مڑو، اور اس کے اندر ایک نمونہ دہراؤ۔ نیسٹنگ سادہ تکرار سے پیچیدہ رویہ بناتی ہے۔ کسٹم بلاکس (اسکریچ کے فنکشنز) مراحل کو ایک نام کے تحت جمع کرتے ہیں جیسے 'مربع بناؤ' تاکہ دوبارہ استعمال ہو سکیں۔ کلوننگ چلتے وقت اسپرائٹ کی کاپیاں بناتی ہے جیسے کھیل میں گرتے ہوئے کئی سیب، ہر ایک آزادانہ عمل کرتا ہے۔

Loops, Nesting, Functions and CloningNested Loops→Custom Blocks→Clone→ReusePunjabTest.com • diagram بنایا گیا ہے, کتاب کی تصویر نہیں
Nesting aur cloning samjho: loop ke andar loop, aik naam ke neeche steps, clone se kai copies.
4. Building and Debugging a Scratch Projectاسکریچ منصوبہ بنانا اور خرابی دور کرنا
🏷 Tags: project, debug, test, share
ENGLISH

Build a project in small steps: first make one sprite move, test it, then add a second behaviour, test again. Testing after every small change makes bugs easy to find — you know the bug is in the last thing you changed.

Common Scratch bugs: a script that never starts (no event block), a loop without an exit, and two scripts fighting over one sprite. Read the blocks aloud, one by one — the bug is usually a block in the wrong order.

اردو

منصوبہ چھوٹے مراحل میں بنائیں: پہلے ایک اسپرائٹ کو حرکت دیں، جانچیں، پھر دوسرا رویہ شامل کریں، دوبارہ جانچیں۔ ہر چھوٹی تبدیلی کے بعد جانچ سے خرابی آسانی سے مل جاتی ہے کیونکہ آپ جانتے ہیں کہ خرابی آخری تبدیلی میں ہے۔ عام خرابیاں: اسکرپٹ جو کبھی شروع نہ ہو (ایونٹ بلاک نہیں)، بغیر نکلنے کے لوپ، اور دو اسکرپٹس کا ایک اسپرائٹ پر جھگڑا۔ بلاکس کو بلند آواز میں ایک ایک کر کے پڑھیں — خرابی عام طور پر غلط ترتیب میں ہوتا ہے۔

Building and Debugging a Scratch ProjectSmall Steps→Test Often→Find Bug→Fix + RetestPunjabTest.com • diagram بنایا گیا ہے, کتاب کی تصویر نہیں
Debugging samjho: چھوٹا قدم, فوراً جانچ — bug آخری تبدیلی میں ملتا ہے.
📝 Exercise Questions — with Answers📝 مشق کے سوالات — جوابات کے ساتھ

اس chapter کی exercise SLO-based practice ہے — MCQs, short اور long سوال اس guide کے لیے لکھے گئے ہیں, کتاب کی official exercise نہیں. جواب کے ساتھ practice کرو.

Section A: Multiple Choice Questionsحصہ الف: کثیر الانتخابی سوالات

1. Scratch programs are built from:

  • Typed code only
  • Drag-and-drop blocks ✓
  • Wires
  • Spreadsheets
Answer / جواب

Answer: (b) — Scratch uses blocks that snap together.

2. A sprite is:

  • A type of computer
  • A character or object on the stage ✓
  • A sound file
  • A cable
Answer / جواب

Answer: (b) — Sprites are the characters/objects that act on the stage.

3. Which block starts a script when the green flag is clicked?

  • Motion block
  • Event block ✓
  • Sound block
  • Pen block
Answer / جواب

Answer: (b) — Event blocks start scripts, for example 'when green flag clicked'.

4. A loop inside another loop is called:

  • A broken loop
  • A nested loop ✓
  • A single loop
  • A sprite
Answer / جواب

Answer: (b) — Loops inside loops are nested loops.

5. Cloning in Scratch means:

  • Copying homework
  • Creating copies of a sprite while the program runs ✓
  • Deleting a sprite
  • Changing colours
Answer / جواب

Answer: (b) — Cloning creates run-time copies of a sprite, each acting independently.

6. The best way to find a Scratch bug is:

  • Rewrite everything
  • Test after every small change ✓
  • Never test
  • Ask the computer
Answer / جواب

Answer: (b) — Testing after every small change shows the bug is in the last change.

Section B: Short Questionsحصہ ب: مختصر سوالات
1. What is Scratch?

Answer: Scratch is a visual programming language in which programs are built by dragging blocks together instead of typing code.

2. How does Scratch show selection (if)?

Answer: With control blocks such as 'if ... then ...', which run enclosed blocks only when the condition is true.

3. What is a variable in Scratch? Give an example.

Answer: A variable stores a value that can change, for example a score that increases when a sprite catches an apple.

4. What is a custom block, and why use one?

Answer: A custom block bundles steps under one name (for example 'draw square') so the steps can be reused without copying them everywhere.

5. A Scratch game freezes. Name two likely causes.

Answer: A loop with no exit condition, or a script that never starts because it has no event block.

Section C: Long Questionsحصہ ج: تفصیلی سوالات
1. Design a simple Scratch catching game and explain its blocks.

Answer: Sprites: a basket (player) and falling apples (clones). Events: when green flag clicked, set score to 0 and start a forever loop that creates an apple clone every second. Motion: the basket moves with arrow keys; apples fall by changing y. Control: if an apple touches the basket, change score by 1 and delete the clone. Sensing detects the touch; variables hold the score. Test after each addition.

2. Explain loops, nesting and functions in Scratch with examples.

Answer: Loop: repeat 4 times {move 50 steps, turn 90 degrees} draws a square. Nested loop: repeat 3 times {draw a square, move aside} draws three squares — a loop inside a loop. Function (custom block): define 'draw square' once with the loop inside, then call it wherever a square is needed instead of repeating the blocks.

3. How do you debug a Scratch project step by step?

Answer: First check the script starts: is there an event block? Then read blocks aloud in order and check each condition. Test after every small change so the bug is in the last change. Use 'say' blocks to show variable values while running. Fix one thing at a time and retest; never change several blocks at once, or you will not know which change fixed it.

📌 باب کا خلاصہ و رہنمائی — اس باب میں کیا ہے؟
ENGLISH SUMMARY

Scratch teaches real programming without typing errors: sprites act on a stage, event blocks start scripts, control blocks give loops and conditions, variables hold scores, custom blocks reuse steps, clones multiply sprites, and testing after every small change finds bugs fast.

Revision guidance: پہلے MCQs خود حل کرو, پھر جواب ملاؤ; short سوالوں کے جواب اپنے الفاظ میں لکھ کر practice کرو; long سوالوں کے لیے ہر section کی headings اور مثالیں یاد رکھو.

اردو خلاصہ

اسکریچ ٹائپنگ کی غلطیوں کے بغیر حقیقی پروگرامنگ سکھاتا ہے: اسپرائٹس اسٹیج پر عمل کرتے ہیں، ایونٹ بلاکس اسکرپٹ شروع کرتے ہیں، کنٹرول بلاکس لوپ اور شرائط دیتے ہیں، ویری ایبلز اسکور رکھتے ہیں، کسٹم بلاکس مراحل دوبارہ استعمال کرتے ہیں، کلونز اسپرائٹس بڑھاتے ہیں، اور ہر چھوٹی تبدیلی کے بعد جانچ خرابیاں جلد ڈھونڈ لیتی ہے۔

رہنمائی: پہلے ایم سی کیوز خود حل کریں پھر جوابات ملائیں؛ مختصر سوالات کے جوابات اپنے الفاظ میں لکھ کر مشق کریں؛ تفصیلی سوالات کے لیے ہر سیکشن کی سرخیاں اور مثالیں یاد رکھیں۔

Is chapter ke topics: What Is Scratch? · Scratch and Programming Concepts · Loops, Nesting, Functions and Cloning · Building and Debugging a Scratch Project · مشق

Topics (Urdu): اسکریچ کیا ہے؟ · اسکریچ اور پروگرامنگ کے تصورات · لوپس، نیسٹنگ، فنکشنز اور کلوننگ · اسکریچ منصوبہ بنانا اور خرابی دور کرنا

Revision guidance: پہلے MCQs خود حل کرو, پھر جواب ملاؤ; short سوالوں کے جواب اپنے الفاظ میں لکھ کر practice کرو; long سوالوں کے لیے ہر section کی headings اور مثالیں یاد رکھو.

🎯 مزید MCQs اور Tests کے لیے

Chapter-wise tests, fresh random papers اور instant score کے لیے PunjabTest.com کا میں test section دیکھو:

PunjabTest.com — Tests →

PunjabTest.com — Complete Guide Book • Class 8 Computer Science, Chapter 6 (SLO-based practice (not the official book exercise), Session 2026–27) • English + Urdu

← Chapter 5 — Computational ThinkingChapter 7 — Digital Citizenship →