← Computer Science X past papers

Computer Science X · 2024 · E-Marking Notes (Questions & Solved Better Responses)

AGA KHAN UNIVERSITY EXAMINATION BOARD
Notes from E-Marking Centre on SSC-II Computer Science Annual Examinations 2024
Digital Edition: Questions, Marking Schemes & Solved Better Responses (2025 Syllabus Aligned)
Q.1Constructed Response Questions (CRQs)
2025 Syllabus Outcome (9.1.2): draw flowcharts related to SLO # 9.1.1.
Question Text
Consider the given table.
DescriptionFlowchart Symbol (Shown in Diagram)
A. All the calculations appear inside this symbol.Circle (○)
B. It is used to connect various flowchart symbols.Parallelogram (▱)
C. It is used to represent input and output in a flowchart.Rectangle (▭)
D. It is used to connect one part of flowchart with another on the same page.Arrow (→)
Identify the CORRECT flowchart symbol for each description (A, B, C, D) in the given table.
Diagram for Q.1
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (2/2)
DescriptionCorrect Flowchart SymbolSymbol Name
ARectangle (`▭`)Process Symbol (All arithmetic calculations and assignments appear inside a rectangle)
BArrow (`→`)Flowline Symbol (Connects various flowchart symbols and shows direction of flow)
CParallelogram (`▱`)Input / Output Symbol (Represents reading input or displaying output in a flowchart)
DCircle (`○`)On-Page Connector Symbol (Connects one part of a flowchart to another on the same page)
Q.2Constructed Response Questions (CRQs)
2025 Syllabus Outcome (10.4.3): write JavaScript code to implement the following statements: a. if statement, b. if-else statement, c. if-else or if-else-if, d. switch statement;
Question Text
A C program is written to take three angles of a triangle as an input and identify whether the formation of triangle is possible or not.
Complete the missing part in the program to achieve the given task.
CSource Code
#include <stdio.h>
int main() {
  float a1, a2, a3, sum;
  printf("Enter three angles of a triangle: \n");
  scanf("%f %f %f", &a1, &a2, &a3);

  /* Complete the missing code here */

  return 0;
}
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (3/3)
Completed Missing Code (C Language):
CSource Code
sum = a1 + a2 + a3;
if (sum == 180 && a1 > 0 && a2 > 0 && a3 > 0)
{
    printf("Triangle formation is possible.\n");
}
else
{
    printf("Triangle formation is not possible.\n");
}
2025 Syllabus Equivalent (JavaScript):
JAVASCRIPTSource Code
let sum = a1 + a2 + a3;
if (sum === 180 && a1 > 0 && a2 > 0 && a3 > 0) {
    document.write("Triangle formation is possible.");
} else {
    document.write("Triangle formation is not possible.");
}
Q.3Constructed Response Questions (CRQs)
2025 Syllabus Outcome (10.5.4): write the output of a given program having a loop and selection structures;
Question Text
Consider the following C program.
CSource Code
#include <stdio.h>
int main() {
  int x=14;
  int y=20;
  while (y>x)
  {
    printf("\n%d", x);
    x+=2;
  }
  return 0;
}
Complete the trace table for the given program.
xyOutput
1420
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (3/3)
IterationxyCondition (y > x)Output
1142020 > 14 (True)14
2162020 > 16 (True)16
3182020 > 18 (True)18
4 (Exit)202020 > 20 (False)(Loop terminates)
Q.4Constructed Response Questions (CRQs)
Out of 2025 Syllabus5 Marks • Level Application
Question Text
In the given diagram, two switches (A and B) send values to a logic circuit giving X as the output.
X has a value of 1 with the following conditions:
Architecture / Topology Diagram
Switch A sends value 1 OR switch B sends value 0
                      AND
Switch A sends value 0 OR switch B sends value 0
                      AND
Switch A sends value 1 OR switch B sends value 1
i. Draw the logic circuit to represent the given conditions. (3 Marks)
ii. Complete the truth table for the logic circuit drawn in part i. (2 Marks)
ABWorking SpaceX
00
01
10
11
Diagram for Q.4
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (5/5)
i. Boolean Expression & Logic Circuit Architecture (3 Marks)
•Condition 1: Switch A = 1 OR Switch B = 0 →(A+B‾)\rightarrow (A + \overline{B})
•Condition 2: Switch A = 0 OR Switch B = 0 →(A‾+B‾)\rightarrow (\overline{A} + \overline{B})
•Condition 3: Switch A = 1 OR Switch B = 1 →(A+B)\rightarrow (A + B)
•Combined Product-of-Sums (POS) Expression:
X=(A+B‾)⋅(A‾+B‾)⋅(A+B)X = (A + \overline{B}) \cdot (\overline{A} + \overline{B}) \cdot (A + B)
*(Note: If interpreted as the three input combinations (A,B)∈{(1,0),(0,0),(1,1)}(A,B) \in \{(1,0), (0,0), (1,1)\} that make X=1X=1, the Sum-of-Products expression is X=AB‾+A‾B‾+AB=A+B‾X = A\overline{B} + \overline{A}\overline{B} + AB = A + \overline{B}.)*
ii. Completed Truth Table (2 Marks)
**Method A — Literal Clause-by-Clause Evaluation X=(A+B‾)⋅(A‾+B‾)⋅(A+B)X = (A + \overline{B}) \cdot (\overline{A} + \overline{B}) \cdot (A + B):**
ABA‾\overline{A}B‾\overline{B}C1=A+B‾C_1 = A + \overline{B}C2=A‾+B‾C_2 = \overline{A} + \overline{B}C3=A+BC_3 = A + BX=C1⋅C2⋅C3X = C_1 \cdot C_2 \cdot C_3
00111100
01100110
10011111
11001010
**Method B — Minterm Interpretation (X=1X = 1 for (A,B)=(1,0),(0,0),(1,1)(A,B) = (1,0), (0,0), (1,1), i.e., X=AB‾+A‾B‾+ABX = A\overline{B} + \overline{A}\overline{B} + AB):**
ABA‾B‾\overline{A}\overline{B}AB‾A\overline{B}ABABX=A‾B‾+AB‾+ABX = \overline{A}\overline{B} + A\overline{B} + AB
001001
010000
100101
110011
Q.5aExtended Response Questions (ERQs)
2025 Syllabus Outcome (10.4.3): write JavaScript code to implement the following statements: a. if statement, b. if-else statement, c. if-else or if-else-if, d. switch statement;
Question Text
EITHER (a): Write a C program to take a year as an input, identify and print whether the inputted year is a leap year or not.
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Identify Whether an Inputted Year is a Leap Year or Not
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int year;
    printf("Enter a year: ");
    scanf("%d", &year);
    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))
    {
        printf("%d is a leap year.\n", year);
    }
    else
    {
        printf("%d is not a leap year.\n", year);
    }
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let year = Number(prompt("Enter a year:"));
if ((year % 400 === 0) || (year % 4 === 0 && year % 100 !== 0)) {
    document.write(year + " is a leap year.");
} else {
    document.write(year + " is not a leap year.");
}
Option (b): Print the First Ten Numbers of the Fibonacci Series Using for Loop
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int i, n = 10, t1 = 0, t2 = 1, nextTerm;
    printf("First 10 numbers of Fibonacci series: ");
    for (i = 1; i <= n; i++)
    {
        printf("%d ", t1);
        nextTerm = t1 + t2;
        t1 = t2;
        t2 = nextTerm;
    }
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let t1 = 0, t2 = 1, nextTerm;
for (let i = 1; i <= 10; i++) {
    document.write(t1 + " ");
    nextTerm = t1 + t2;
    t1 = t2;
    t2 = nextTerm;
}
Q.5bExtended Response Questions (ERQs)
2025 Syllabus Outcome (10.5.3): write JavaScript code to implement the following loops: a. for loop, b. while loop, c. do while loop, d. nested loop;
Question Text
OR (b): Write a C program to print the first ten numbers of Fibonacci series using for loop.
(Fibonacci series: 0 1 1 2 3 5 8 13 21 34 . . .)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Identify Whether an Inputted Year is a Leap Year or Not
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int year;
    printf("Enter a year: ");
    scanf("%d", &year);
    if ((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0))
    {
        printf("%d is a leap year.\n", year);
    }
    else
    {
        printf("%d is not a leap year.\n", year);
    }
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let year = Number(prompt("Enter a year:"));
if ((year % 400 === 0) || (year % 4 === 0 && year % 100 !== 0)) {
    document.write(year + " is a leap year.");
} else {
    document.write(year + " is not a leap year.");
}
Option (b): Print the First Ten Numbers of the Fibonacci Series Using for Loop
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int i, n = 10, t1 = 0, t2 = 1, nextTerm;
    printf("First 10 numbers of Fibonacci series: ");
    for (i = 1; i <= n; i++)
    {
        printf("%d ", t1);
        nextTerm = t1 + t2;
        t1 = t2;
        t2 = nextTerm;
    }
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let t1 = 0, t2 = 1, nextTerm;
for (let i = 1; i <= 10; i++) {
    document.write(t1 + " ");
    nextTerm = t1 + t2;
    t1 = t2;
    t2 = nextTerm;
}
Q.6aExtended Response Questions (ERQs)
2025 Syllabus Outcome (13.1.2): apply digital technology tools to improve communication, security, and problem-solving in daily life;
Question Text
EITHER (a): You are a business owner running a small online store. You have just heard about a recent cyber-attack on a similar online store that resulted in customer data theft and financial losses.
i.Describe in THREE points why computer security is vital for your business? (3 Marks)
ii.Describe THREE specific computer security measures or practices that you would implement to protect your online store from cyber threats. (3 Marks)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Online Store Cybersecurity Scenario
i. Why Computer Security is Vital for an Online Business (3 Marks):
1.Protection of Sensitive Customer Data: Safeguards customers' personal details, shipping addresses, and credit/debit card payment credentials from data breaches and identity theft.
2.Prevention of Financial Loss & Business Disruption: Prevents ransomware, fraudulent transactions, regulatory fines, and costly website downtime caused by DDoS or malware attacks.
3.Preservation of Brand Reputation & Customer Trust: Maintains customer confidence so shoppers feel safe purchasing from the online store without fear of compromise.
ii. Three Specific Computer Security Measures to Protect the Online Store (3 Marks):
1.Strong Authentication & Access Control: Enforce complex passwords and Two-Factor Authentication (2FA / MFA) for admin panels and customer accounts, along with role-based access levels.
2.SSL/TLS Encryption & Firewalls: Use HTTPS (SSL/TLS) encryption for all checkout/payment traffic and deploy a Web Application Firewall (WAF) and updated anti-malware software.
3.Regular Software Patching & Encrypted Backups: Keep the e-commerce platform, plugins, and server OS updated with security patches, and maintain regular off-site encrypted database backups.
Option (b): Computer Virus and Its Transmission Vectors
i. Description of a Computer Virus (2 Marks):
A computer virus is a malicious software program that attaches itself to a legitimate host file or executable program and replicates itself when the infected host program is executed by a user, corrupting data, deleting files, or degrading system performance.
ii. Four Ways by Which a Virus Can Spread in a Computer System (4 Marks):
1.Infected Removable Storage Media (USB Flash Drives / External Hard Drives / CDs): Plugging in and opening files from an infected USB drive transfers the virus to the host computer.
2.Malicious Email Attachments & Phishing Links: Opening infected .exe, .docm, or .zip attachments received via email executes the embedded virus payload.
3.Downloading Pirated or Untrusted Software from the Internet: Installing cracked games, pirated applications, or files from unverified websites bundles hidden viruses onto the system.
4.Local Area Networks (LAN) & Shared Network Folders: Viruses can propagate across shared network drives when users execute infected shared files.
Q.6bExtended Response Questions (ERQs)
Out of 2025 Syllabus6 Marks • Level Understanding
Question Text
OR (b):
i.Describe computer virus. (2 Marks)
ii.Give any FOUR ways by which a virus can spread in a computer system. (4 Marks)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Online Store Cybersecurity Scenario
i. Why Computer Security is Vital for an Online Business (3 Marks):
1.Protection of Sensitive Customer Data: Safeguards customers' personal details, shipping addresses, and credit/debit card payment credentials from data breaches and identity theft.
2.Prevention of Financial Loss & Business Disruption: Prevents ransomware, fraudulent transactions, regulatory fines, and costly website downtime caused by DDoS or malware attacks.
3.Preservation of Brand Reputation & Customer Trust: Maintains customer confidence so shoppers feel safe purchasing from the online store without fear of compromise.
ii. Three Specific Computer Security Measures to Protect the Online Store (3 Marks):
1.Strong Authentication & Access Control: Enforce complex passwords and Two-Factor Authentication (2FA / MFA) for admin panels and customer accounts, along with role-based access levels.
2.SSL/TLS Encryption & Firewalls: Use HTTPS (SSL/TLS) encryption for all checkout/payment traffic and deploy a Web Application Firewall (WAF) and updated anti-malware software.
3.Regular Software Patching & Encrypted Backups: Keep the e-commerce platform, plugins, and server OS updated with security patches, and maintain regular off-site encrypted database backups.
Option (b): Computer Virus and Its Transmission Vectors
i. Description of a Computer Virus (2 Marks):
A computer virus is a malicious software program that attaches itself to a legitimate host file or executable program and replicates itself when the infected host program is executed by a user, corrupting data, deleting files, or degrading system performance.
ii. Four Ways by Which a Virus Can Spread in a Computer System (4 Marks):
1.Infected Removable Storage Media (USB Flash Drives / External Hard Drives / CDs): Plugging in and opening files from an infected USB drive transfers the virus to the host computer.
2.Malicious Email Attachments & Phishing Links: Opening infected .exe, .docm, or .zip attachments received via email executes the embedded virus payload.
3.Downloading Pirated or Untrusted Software from the Internet: Installing cracked games, pirated applications, or files from unverified websites bundles hidden viruses onto the system.
4.Local Area Networks (LAN) & Shared Network Folders: Viruses can propagate across shared network drives when users execute infected shared files.