
SLO-based practice chapter: no clean official PCTB book PDF for Class 7 Computer Science was available at build time, so this chapter is built from the PCTB/SNC Student Learning Outcomes (SLOs) for Class 7 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.
A program is a set of instructions a computer follows to do a task. A programming language is a formal language for writing those instructions — computers only understand 0s and 1s, so languages translate human ideas into machine steps.
Languages come in levels: machine language (0s and 1s, hard for humans), assembly language (short codes like ADD and MOV), and high-level languages (words closer to English, like Python and Scratch blocks).
پروگرام ہدایات کا مجموعہ ہے جس پر کمپیوٹر کسی کام کے لیے عمل کرتا ہے۔ پروگرامنگ زبان ان ہدایات کو لکھنے کی رسمی زبان ہے — کمپیوٹر صرف 0 اور 1 سمجھتا ہے اس لیے زبانیں انسانی خیالات کو مشینی مراحل میں بدلتی ہیں۔ زبانوں کی سطحیں ہیں: مشین زبان (0 اور 1، انسانوں کے لیے مشکل)، اسمبلی زبان (ADD اور MOV جیسے مختصر کوڈ) اور اعلیٰ سطحی زبانیں (انگریزی سے قریب الفاظ جیسے پائتھن اور اسکریچ بلاکس)۔
A variable is a named box that stores a value that can change — for example, score = 0, and score grows as a game goes on. Data comes in types: numbers (for maths), text (names and messages), and true/false values (for decisions).
Choosing the right type matters: you cannot add two names like numbers, and storing a phone number as a number would lose a leading zero — so phone numbers are stored as text.
ویری ایبل ایک نام والا ڈبہ ہے جو بدلنے والی قدر محفوظ کرتا ہے — مثلاً اسکور = 0، اور کھیل چلنے کے ساتھ اسکور بڑھتا ہے۔ ڈیٹا کی اقسام ہیں: اعداد (حساب کے لیے)، متن (نام اور پیغامات) اور درست/غلط قدریں (فیصلوں کے لیے)۔ درست قسم چننا اہم ہے: دو ناموں کو اعداد کی طرح جمع نہیں کر سکتے، اور فون نمبر کو عدد بنا کر رکھنے سے شروع کا صفر ضائع ہو جائے گا اس لیے فون نمبر متن کے طور پر محفوظ ہوتا ہے۔
Programs run in sequence (one step after another), unless a decision changes the path: 'if the password is correct, open the account, else show an error'. Loops repeat steps: 'repeat 5 times: print your name'.
These three ideas — sequence, decision, loop — build every program, from a calculator to a game. Learning to spot them in a problem is the heart of programming.
پروگرام ترتیب سے چلتے ہیں (ایک مرحلہ دوسرے کے بعد) جب تک کوئی فیصلہ راستہ نہ بدلے: 'اگر پاس ورڈ درست ہو تو اکاؤنٹ کھولو ورنہ غلطی دکھاؤ'۔ لوپس مراحل دہراتے ہیں: '5 بار دہراؤ: اپنا نام چھاپو'۔ یہ تین خیالات — ترتیب، فیصلہ، لوپ — ہر پروگرام بناتے ہیں، کیلکولیٹر سے لے کر کھیل تک۔ کسی مسئلے میں انہیں پہچاننا پروگرامنگ کا دل ہے۔
Writing a program has steps: understand the task, write the steps (algorithm), write the code, run it, and fix the errors it shows. Errors are normal — even experts make them daily.
Debugging means finding and fixing errors: read the error message, check the line it points to, test with simple data first, and fix one error at a time. A program that works on simple data can then be tested on harder data.
پروگرام لکھنے کے مراحل ہیں: کام سمجھو، مراحل لکھو (الگورتھم)، کوڈ لکھو، چلاؤ اور غلطیاں درست کرو۔ غلطیاں معمول کی بات ہیں — ماہرین بھی روز کرتے ہیں۔ ڈیبگنگ یعنی غلطیاں ڈھونڈنا اور درست کرنا: غلطی کا پیغام پڑھو، جس سطر کی طرف اشارہ ہو اسے دیکھو، پہلے سادہ ڈیٹا سے جانچو اور ایک وقت میں ایک غلطی درست کرو۔ سادہ ڈیٹا پر چلنے والا پروگرام پھر مشکل ڈیٹا پر جانچا جا سکتا ہے۔
اس chapter کی exercise SLO-based practice ہے — MCQs, short اور long سوال اس guide کے لیے لکھے گئے ہیں, کتاب کی official exercise نہیں. جواب کے ساتھ practice کرو.
1. A program is:
Answer: (b) — A program is instructions for a task.
2. Machine language uses:
Answer: (b) — Machine language is binary: 0s and 1s.
3. A variable is:
Answer: (b) — A variable stores a value that can change, like a score.
4. Which is a decision in a program?
Answer: (b) — If/else decisions choose a path based on a condition.
5. A loop is used to:
Answer: (b) — Loops repeat steps while a condition holds.
6. Debugging means:
Answer: (b) — Debugging is finding and fixing program errors.
Answer: A programming language is a formal language for writing the instructions that make up a program, translating human ideas into steps a computer can follow.
Answer: Because storing it as a number would lose a leading zero and because phone numbers are never used in maths; text keeps every digit exactly.
Answer: Assembly uses short codes like ADD and MOV, close to the machine and hard to read. High-level languages use words closer to English, are easier to write and read, and work on many machines.
Answer: Sequence: boil water, then add tea leaves, then serve — in order. Decision: if it rains, take an umbrella. Loop: repeat 5 times: write your name.
Answer: Read the error message carefully and look at the line it points to, then test with simple data before changing anything else.
Answer: Machine language is 0s and 1s — the only language hardware understands directly, but very hard for humans. Assembly language uses short mnemonic codes like ADD and MOV for machine operations; it is easier than binary but still tied to one machine type. High-level languages (Python, Scratch) use English-like words and ready-made commands, are much easier to learn and read, and are translated into machine code by translators (compilers/interpreters).
Answer: Algorithm: (1) Input a number N. (2) If N divided by 2 leaves remainder 0, print 'Even', else print 'Odd'. Code outline: input N; if N % 2 == 0: print('Even') else: print('Odd'). Test: N=8 → remainder 0 → Even. N=7 → remainder 1 → Odd. The decision (if/else) is the heart of the program.
Answer: Errors are normal because programs are long chains of exact steps — one wrong symbol breaks the chain, and even experts make errors daily. Debugging: read the error message, find the line it points to, test with simple data, fix one error at a time, and re-run. Keeping a calm, step-by-step approach turns errors from frustration into the main way programmers learn.
Programming turns ideas into instructions a computer follows: programs are written in languages from machine code to high-level words, use variables to store values, and are built from sequence, decisions and loops — then tested and debugged until they work.
Revision guidance: پہلے MCQs خود حل کرو, پھر جواب ملاؤ; short سوالوں کے جواب اپنے الفاظ میں لکھ کر practice کرو; long سوالوں کے لیے ہر section کی headings اور مثالیں یاد رکھو.
پروگرامنگ خیالات کو ان ہدایات میں بدلتی ہے جن پر کمپیوٹر عمل کرتا ہے: پروگرام مشین کوڈ سے لے کر اعلیٰ سطحی الفاظ تک کی زبانوں میں لکھے جاتے ہیں، قدریں محفوظ کرنے کے لیے ویری ایبلز استعمال کرتے ہیں، اور ترتیب، فیصلوں اور لوپس سے بنتے ہیں — پھر جانچے اور درست کیے جاتے ہیں یہاں تک کہ کام کرنے لگیں۔
رہنمائی: پہلے ایم سی کیوز خود حل کریں پھر جوابات ملائیں؛ مختصر سوالات کے جوابات اپنے الفاظ میں لکھ کر مشق کریں؛ تفصیلی سوالات کے لیے ہر سیکشن کی سرخیاں اور مثالیں یاد رکھیں۔
Is chapter ke topics: What Is a Program? · Programming Concepts: Data and Variables · Sequence, Decisions and Loops in Programs · Writing and Testing a First Program · مشق
Topics (Urdu): پروگرام کیا ہے؟ · پروگرامنگ تصورات: ڈیٹا اور ویری ایبلز · پروگراموں میں ترتیب، فیصلے اور لوپس · پہلا پروگرام لکھنا اور جانچنا
Revision guidance: پہلے MCQs خود حل کرو, پھر جواب ملاؤ; short سوالوں کے جواب اپنے الفاظ میں لکھ کر practice کرو; long سوالوں کے لیے ہر section کی headings اور مثالیں یاد رکھو.
Chapter-wise tests, fresh random papers اور instant score کے لیے PunjabTest.com کا میں test section دیکھو:
PunjabTest.com — Complete Guide Book • Class 7 Computer Science, Chapter 4 (SLO-based practice (not the official book exercise), Session 2026–27) • English + Urdu