Sir Basit Notes

Class 10 Computer Science Pba Notes and Solved Model Paper (FBISE)

⬇ Download all PBA notes (PDF) (375 KB)All PBA sections

SSC Computer Science PBA uses Domain C (web: HTML, CSS, JavaScript) for the 24 marks of Section A, and Domains B (algorithms), A (computer systems) and H (entrepreneurship) for Section B. Note that Section A is on the web, not Python or C.

A. Section A: Web practicals

CS-1. HTML page skeleton and the tags to know

<!DOCTYPE html>
<html>
<head>
  <title>My Portfolio</title>
  <link rel="stylesheet" href="style.css">   <!-- or a <style> block -->
</head>
<body>
  <header><h1>Name</h1><p>Short intro</p></header>
  <nav><a href="#home">Home</a> | <a href="#about">About Me</a> | <a href="#contact">Contact</a></nav>
  <main>
    <img src="profile.jpg" alt="Profile picture">
    <p>Short biography.</p>
    <ul><li>HTML</li><li>CSS</li><li>JavaScript</li></ul>
  </main>
</body>
</html>
  • Formatting: <b>, <i>, <u>, <h1> to <h6>, <br>, <hr>. Anchor: <a href="url">. Image: <img src alt>. Lists: <ul> (bullets), <ol> (numbers), <dl><dt><dd> (definition). Table: <table>, <tr> row, <th> header cell, <td> data cell.

CS-2. CSS (inline, internal, external) and common properties

selector { property: value; }
h1 { color: blue; text-align: center; font-size: 24px; }
th { color: lightblue; }
img { width: 300px; height: 200px; }
table { border: 1px solid black; border-collapse: collapse; }
a:hover { color: red; }          /* hover effect */
div { margin: 10px; padding: 5px; background-color: #eee; position: relative; }
  • Text styling (color, font-size, text-align), colours, spacing (margin outside, padding inside), borders, positioning (static, relative, absolute, fixed), backgrounds, hover effects.

CS-3. JavaScript basics: variables, I/O, loops, functions, debugging

let a = 20, b = 60, c = 75;          // variables (let, const)
let total = a + b + c;
document.write(total);                // output on the page
console.log(total);                   // output in the console
let n = Number(prompt("Enter number"));   // input

if (n > 0) { alert("Positive"); } else if (n < 0) { alert("Negative"); } else { alert("Zero"); }

for (let i = 1; i <= 10; i++) { document.write(n + " x " + i + " = " + n*i + "<br>"); }   // table

let f = 1; for (let i = 1; i <= n; i++) { f *= i; }          // factorial

function area(r) { return 3.14159 * r * r; }                  // function

let big = a; if (b > big) big = b; if (c > big) big = c;       // largest of three

let list = [5, 2, 9, 1];
let found = list.indexOf(9);          // search (found = -1 if absent)
list.sort(function(x, y){ return x - y; });   // ascending sort
  • Debugging: syntax errors (missing bracket, wrong keyword case) stop the code, logical errors (wrong condition) give wrong output. Use console.log() and the browser console to find them.

B. Section B practicals

CS-4. Devices and software (labelling questions)

CategoryExamples
Input deviceskeyboard, mouse, scanner, microphone, webcam
Output devicesmonitor, printer, speakers, projector
Processing devicesCPU (processor, e.g. Intel Core i7), microprocessor, motherboard
Storage deviceshard disk, SSD, USB flash drive, memory card (SD or microSD), external hard drive
Communication devicesmodem, router, network interface card, Wi-Fi adapter
System softwareoperating system (Windows, Linux, MS-DOS), utility programs (antivirus such as AVG, disk cleanup), language translators (compiler, interpreter, assembler), device drivers
Application softwareproductivity (MS Word, Excel), business (accounting), entertainment (games, media players), education software, browsers (Chrome)

CS-5. Flowchart symbols, concept map and algorithms

  • Symbols: oval = start/stop, rectangle = process, parallelogram = input/output, diamond = decision (Yes/No), arrows = flow. A concept map shows ideas as boxes joined by labelled lines.
  • Algorithm patterns to practise: sum of numbers, even/odd, factorial, table, largest/smallest, linear search, bubble sort.
Factorial (pseudocode)         Largest of three
START                          START
INPUT n                        INPUT a, b, c
f = 1                          max = a
FOR i = 1 TO n                 IF b > max THEN max = b
   f = f * i                   IF c > max THEN max = c
PRINT f                        PRINT max
END                            END

CS-6. Business plan (Executive summary, objectives, product specification, market)

  • Company name and slogan: short, catchy. Executive summary: one line on what the business is and who it serves. Objectives: main goals (for example, deliver healthy meals within 30 minutes, reduce plastic waste). Product specification: pricing, promotion, packaging, delivery. Potential customers: target groups.

C. Model paper solved (Computer Science, 40 marks)

Q.1 (10 marks)

a. Debug (5 marks). Errors found: (1) let 4 = rows; should be let rows = 4; (variable on the left). (2) Condition i < 0 should be i > 0 (the loop would never run). (3) Inner loop j < i should be j <= i (to print i stars, the output shows 4, 3, 2, 1 stars). (4) The inner for loop has a closing brace but no opening brace (missing {). (5) Document.write should be document.write (JavaScript is case sensitive). (6) Missing semicolon after let pattern = "". (7) Add <br> so each row prints on a new line.
let rows = 4;
for (let i = rows; i > 0; i--) {
  let pattern = "";
  for (let j = 1; j <= i; j++) {
    pattern += "* ";
  }
  document.write(pattern + "<br>");
}
Output: row of 4 stars, then 3, then 2, then 1.
b. Shopping cart (5 marks).
let item1 = 20, item2 = 60, item3 = 75;
let totalPrice = item1 + item2 + item3;
document.write("Total price = " + totalPrice);   // prints 155
OR a. Negative or positive (5 marks).
let num = Number(prompt("Enter a number"));
if (num < 0) { alert("The number is negative"); }
else if (num > 0) { alert("The number is positive"); }
else { alert("The number is zero"); }
OR b. Output (5 marks). The loop runs 10 times (i = 0 to 9) and adds start + i x step = 1 + 2i each time. The array becomes [1,3,5,7,9,11,13,15,17,19], and join(', ') puts it in the element with id "output" (when displaySeries() is called): 1, 3, 5, 7, 9, 11, 13, 15, 17, 19.

Q.2 Personal portfolio page (10 marks)

<!DOCTYPE html>
<html>
<head>
  <title>Ali Khan - My Portfolio</title>                       <!-- a (1) -->
</head>
<body>
  <header>                                                       <!-- b (1) -->
    <h1>Ali Khan</h1>
    <p>I am a student who loves computers and web design.</p>
  </header>

  <nav>                                                          <!-- d (1) -->
    <a href="#home">Home</a> | <a href="#about">About Me</a> | <a href="#contact">Contact</a>
  </nav>

  <main>                                                         <!-- c (3) -->
    <img src="profile.jpg" alt="Profile picture">
    <p>I study in class 10 and enjoy building websites.</p>
    <h3>Skills</h3>
    <ul><li>HTML</li><li>CSS</li><li>JavaScript</li></ul>

    <table border="1">                                           <!-- e (4) -->
      <tr><th>Sr#</th><th>Degree</th><th>Passing year</th><th>GPA/ Grade</th><th>Board/ University</th></tr>
      <tr><td>1</td><td>Matriculation</td><td>2015</td><td>A+</td><td>FBISE</td></tr>
      <tr><td>2</td><td>Intermediate</td><td>2017</td><td>B+</td><td>FBISE</td></tr>
      <tr><td>3</td><td>BS</td><td>2021</td><td>3.56</td><td>AIOU</td></tr>
    </table>
  </main>
</body>
</html>

Q.3 CSS (4 marks)

a. th { color: lightblue; } (foreground colour of the header text; th is the header cell tag of the table).
b. img { width: 300px; height: 200px; } (or give the image an id or class and style it).

Q.4 Library book issue (5 marks, concept map or flowchart)

Flowchart steps (draw with oval, parallelogram, diamond, rectangle):
START
 -> INPUT member ID and book ID
 -> [Decision] Is the book available?
       NO  -> PRINT "Book not available" -> STOP
       YES -> [Decision] Has the user borrowed the maximum number of books (for example 3)?
                 YES -> PRINT "Limit reached" -> STOP
                 NO  -> Issue the book, add to the user's record, mark the book as issued,
                        set the due date -> PRINT "Book issued" -> STOP
OR ATM withdrawal:
START -> Insert card -> Enter PIN -> [PIN correct?]
   NO  -> PRINT "Wrong PIN" (retry up to 3 times, else block card) -> STOP
   YES -> Choose amount -> [Balance >= amount?]
        NO  -> PRINT "Insufficient balance" -> STOP
        YES -> Dispense cash -> Deduct amount from balance -> Print receipt -> Return card -> STOP

Q.5 Devices and software (5 marks)

a. Labels (2.5): i. motherboard (circuit board, processing/main board), ii. CPU (microprocessor, Intel Core i7), iii. microSD memory card, iv. external hard disk drive, v. USB flash drive (pen drive).
b. Classify (2.5): i. MS Excel = application software (productivity). ii. Google Chrome = application software. iii. Windows = system software (operating system). iv. AVG antivirus = system software (utility program). v. MS-DOS = system software (operating system).
The device pictures are small. Image i looks like a green circuit board (motherboard or single-board computer), so the label may be written differently on your sheet. Check against the printed picture.

Q.6 Business plan: MY FOOD CART (6 marks)

Company nameMY FOOD CART
Slogan (1)"Fresh food, fast at your door."
Executive summary (1)MY FOOD CART delivers fresh, healthy and affordable meals to busy professionals and students through a mobile app with real-time tracking.
Objectives, any two (1)1. Deliver every order within 30 minutes. 2. Use eco-friendly packaging to reduce waste.
Product specification (2)Pricing: affordable meal packs (for example Rs 300 to 600) with discounts for students. Promotion: social media ads, first-order discount, referral rewards. Packaging: recyclable, biodegradable boxes, sealed to stay fresh. Delivery: app orders, real-time tracking, delivery in 30 minutes by bike riders.
Potential customers, any two (1)1. Busy office professionals. 2. University and college students in urban areas.