← Computer Science X past papers

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

AGA KHAN UNIVERSITY EXAMINATION BOARD
Notes from E-Marking Centre on SSC-II Computer Science Annual Examinations 2025
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
Write the name and draw the flowchart symbol in front of each description in the given table.
DescriptionNameFlowchart Symbol
All the decisions appear inside this symbol.
It is used to represent input and output in a flowchart.
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (2/2)
DescriptionNameFlowchart Symbol
All the decisions appear inside this symbol.Decision boxDiamond (◇)
It is used to represent input and output in a flowchart.Input / Output boxParallelogram (▱)
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 integers with different values as an input and identify the largest number amongst them.
Write the missing code in the given box to achieve the mentioned task.
CSource Code
#include <stdio.h>
int main( )
{
  int n1, n2, n3;
  printf("Enter three different numbers: \n");
  scanf("%d %d %d", &n1, &n2, &n3);

  /* Write missing conditional logic here */

  return 0;
}
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (3/3)
Missing Conditional Code (C Language):
CSource Code
if ((n1 > n2) && (n1 > n3))
{
    printf("%d is the largest", n1);
}
else if ((n2 > n1) && (n2 > n3))
{
    printf("%d is the largest", n2);
}
else
{
    printf("%d is the largest", n3);
}
2025 Syllabus Equivalent (JavaScript):
JAVASCRIPTSource Code
if ((n1 > n2) && (n1 > n3)) {
    document.write(n1 + " is the largest");
} else if ((n2 > n1) && (n2 > n3)) {
    document.write(n2 + " is the largest");
} else {
    document.write(n3 + " is the largest");
}
Q.3Constructed Response Questions (CRQs)
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
Convert the following for loop into do-while loop.
CSource Code
for (int i=20;i<50;i+=5)
printf("\n%d", i);
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (3/3)
Converted `do-while` Loop (C Language):
CSource Code
int i = 20;
do
{
    printf("\n%d", i);
    i += 5;
}
while (i < 50);
2025 Syllabus Equivalent (JavaScript):
JAVASCRIPTSource Code
let i = 20;
do {
    document.write(i + "<br>");
    i += 5;
} while (i < 50);
Q.4Constructed Response Questions (CRQs)
Out of 2025 Syllabus5 Marks • Level Application
Question Text
Consider the following logic circuit.
i.Write the logic expression to represent the given logic circuit. (1 Mark)
ii.Fill the given truth table for this problem. (4 Marks)
ABCX
000
001
010
011
100
101
110
111
Diagram for Q.4
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (5/5)
i. Boolean Logic Expression (1 Mark):
X=(A⋅B)+C‾X = (A \cdot B) + \overline{C}
ii. Completed Truth Table (4 Marks):
ABCA⋅BA \cdot BC‾\overline{C}X=AB+C‾X = AB + \overline{C}
000011
001000
010011
011000
100011
101000
110111
111101
Q.5aExtended 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
EITHER (a): Write a 'C' program to take table number and range as an input and print the table of inputted number till the inputted range using while loop.
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Multiplication Table up to Inputted Range Using while Loop
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int num, range, i = 1, result;
    printf("Enter a number for table: ");
    scanf("%d", &num);
    printf("Enter range of the table: ");
    scanf("%d", &range);
    while (i <= range)
    {
        result = num * i;
        printf("%d * %d = %d\n", num, i, result);
        i = i + 1;
    }
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let num = Number(prompt("Enter a number for table:"));
let range = Number(prompt("Enter range of the table:"));
let i = 1;
while (i <= range) {
    let result = num * i;
    document.write(num + " * " + i + " = " + result + "<br>");
    i++;
}
Option (b): Check Whether an Input Character is a Vowel or a Consonant
C Program:
CSource Code
#include <stdio.h>
int main()
{
    char ch;
    printf("Enter an alphabet: ");
    scanf(" %c", &ch);
    if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
    {
        if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
            ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
        {
            printf("%c is a vowel", ch);
        }
        else
        {
            printf("%c is a consonant", ch);
        }
    }
    else
    {
        printf("Invalid character");
    }
    return 0;
}
Q.5bExtended 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
OR (b): Write a 'C' program to take a character as an input and print whether the character is a vowel or a consonant.
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Multiplication Table up to Inputted Range Using while Loop
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int num, range, i = 1, result;
    printf("Enter a number for table: ");
    scanf("%d", &num);
    printf("Enter range of the table: ");
    scanf("%d", &range);
    while (i <= range)
    {
        result = num * i;
        printf("%d * %d = %d\n", num, i, result);
        i = i + 1;
    }
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let num = Number(prompt("Enter a number for table:"));
let range = Number(prompt("Enter range of the table:"));
let i = 1;
while (i <= range) {
    let result = num * i;
    document.write(num + " * " + i + " = " + result + "<br>");
    i++;
}
Option (b): Check Whether an Input Character is a Vowel or a Consonant
C Program:
CSource Code
#include <stdio.h>
int main()
{
    char ch;
    printf("Enter an alphabet: ");
    scanf(" %c", &ch);
    if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
    {
        if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
            ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
        {
            printf("%c is a vowel", ch);
        }
        else
        {
            printf("%c is a consonant", ch);
        }
    }
    else
    {
        printf("Invalid character");
    }
    return 0;
}
Q.6aExtended Response Questions (ERQs)
Out of 2025 Syllabus6 Marks • Level Understanding
Question Text
EITHER (a): Explain the following terms:
i.Worm (2 Marks)
ii.Adware (2 Marks)
iii.Trojan horse (2 Marks)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Types of Malware
1.Worm (2 Marks): A standalone malicious program that self-replicates and spreads automatically across computer networks and the internet without requiring a host program or human intervention, consuming network bandwidth and system memory.
2.Adware (2 Marks): Advertising-supported software that automatically displays or downloads unwanted pop-up advertisements and banners onto a user's screen or browser, often bundled with free software and tracking user browsing habits.
3.Trojan Horse (2 Marks): Malicious software disguised as a legitimate, useful, or desirable application to trick users into installing and executing it. Unlike viruses or worms, a Trojan horse does not self-replicate, but opens backdoors, steals credentials, or grants remote control to attackers.
Option (b): Types of Hackers
1.Script Kiddie (2 Marks): An unskilled individual who lacks deep programming or networking expertise and uses pre-written scripts, automated tools, or exploit kits created by other hackers to launch cyberattacks for thrill or notoriety.
2.Blue Hat Hacker (2 Marks): Outside security testers invited by software companies (such as Microsoft) to test a system for bugs and vulnerabilities prior to its public launch (or amateur hackers motivated by personal revenge).
3.Red Hat Hacker (2 Marks): Vigilante hackers who combine ethical intent with aggressive tactics; instead of merely reporting black hat hackers to authorities, they infiltrate black hat infrastructure and launch counter-attacks to destroy malicious servers and botnets.
Q.6bExtended Response Questions (ERQs)
Out of 2025 Syllabus6 Marks • Level Understanding
Question Text
OR (b): Describe the following types of hackers:
i.Script Kiddie (2 Marks)
ii.Blue Hat Hacker (2 Marks)
iii.Red Hat Hacker (2 Marks)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Option (a): Types of Malware
1.Worm (2 Marks): A standalone malicious program that self-replicates and spreads automatically across computer networks and the internet without requiring a host program or human intervention, consuming network bandwidth and system memory.
2.Adware (2 Marks): Advertising-supported software that automatically displays or downloads unwanted pop-up advertisements and banners onto a user's screen or browser, often bundled with free software and tracking user browsing habits.
3.Trojan Horse (2 Marks): Malicious software disguised as a legitimate, useful, or desirable application to trick users into installing and executing it. Unlike viruses or worms, a Trojan horse does not self-replicate, but opens backdoors, steals credentials, or grants remote control to attackers.
Option (b): Types of Hackers
1.Script Kiddie (2 Marks): An unskilled individual who lacks deep programming or networking expertise and uses pre-written scripts, automated tools, or exploit kits created by other hackers to launch cyberattacks for thrill or notoriety.
2.Blue Hat Hacker (2 Marks): Outside security testers invited by software companies (such as Microsoft) to test a system for bugs and vulnerabilities prior to its public launch (or amateur hackers motivated by personal revenge).
3.Red Hat Hacker (2 Marks): Vigilante hackers who combine ethical intent with aggressive tactics; instead of merely reporting black hat hackers to authorities, they infiltrate black hat infrastructure and launch counter-attacks to destroy malicious servers and botnets.