← Computer Science X past papers

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

AGA KHAN UNIVERSITY EXAMINATION BOARD
Notes from E-Marking Centre on SSC-II Computer Science Annual Examinations 2023
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 calculations appear inside this symbol.
It is used to connect various flowchart symbols.
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (2/2)
DescriptionNameFlowchart Symbol
All the calculations appear inside this symbol.ProcessRectangle (`▭`)
It is used to connect various flowchart symbols.Flow linesArrow (`→`)
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 also 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 code 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("Largest number is: %d", n1);
else if ((n2 > n1) && (n2 > n3))
    printf("Largest number is: %d", n2);
else
    printf("Largest number is: %d", n3);
2025 Syllabus Equivalent (JavaScript):
JAVASCRIPTSource Code
if ((n1 > n2) && (n1 > n3)) {
    document.write("Largest number is: " + n1);
} else if ((n2 > n1) && (n2 > n3)) {
    document.write("Largest number is: " + n2);
} else {
    document.write("Largest number is: " + n3);
}
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 m=27;
  int n=36;
  do
  {
    printf("\n%d", n);
    n-=3;
  }
  while (m<n);
  return 0;
}
Complete the trace table for the given program.
mnOutput
2736
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (3/3)
mnOutput
273636
273333
273030
2727— (Loop terminates since `27 < 27` is False)
Q.4Constructed Response Questions (CRQs)
Out of 2025 Syllabus5 Marks • Level Application
Question Text
Two switches, L and M, send values of 0 and 1 to a logic circuit respectively. Value X is the output of the logic circuit.
Output X has a value of 1 with the following conditions:
Architecture / Topology Diagram
Switch L sends value 1 AND switch M sends value 0
                      OR
Switch L sends value 0 AND switch M sends value 0
                      OR
Switch L sends value 1 AND switch M sends value 1
i. Draw the logic circuit to represent the given conditions.
ii. Complete the truth table for the logic circuit drawn in part i.
(Note: Show your working in the given working space. Without working NO mark will be awarded.)
LMWorking SpaceX
00
01
10
11
Diagram for Q.4
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (5/5)
i. Boolean Expression & Logic Circuit (3 Marks)
•Condition 1: Switch L = 1 AND Switch M = 0 →L⋅M‾\rightarrow L \cdot \overline{M}
•Condition 2: Switch L = 0 AND Switch M = 0 →L‾⋅M‾\rightarrow \overline{L} \cdot \overline{M}
•Condition 3: Switch L = 1 AND Switch M = 1 →L⋅M\rightarrow L \cdot M
•Combined Sum-of-Products Expression:
X=(L⋅M‾)+(L‾⋅M‾)+(L⋅M)X = (L \cdot \overline{M}) + (\overline{L} \cdot \overline{M}) + (L \cdot M)
ii. Completed Truth Table (2 Marks)
LML‾\overline{L}M‾\overline{M}LM‾L\overline{M}L‾M‾\overline{L}\overline{M}LMLMX=LM‾+L‾M‾+LMX = L\overline{M} + \overline{L}\overline{M} + LM
00110101
01100000
10011001
11000011
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 print the salary of an employee according to the given conditions.
(Note: Take years of service and gender as an input.)
GenderYears of ServiceSalary
Male>= 5150000
Male< 5100000
Female>= 5200000
Female< 5150000
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int years_of_service;
    char gender;
    printf("Enter Gender (M for Male, F for Female): ");
    scanf(" %c", &gender);
    printf("Enter Years of Service: ");
    scanf("%d", &years_of_service);

    if ((gender == 'M' || gender == 'm') && (years_of_service >= 5))
        printf("Your salary is 150000");
    else if ((gender == 'M' || gender == 'm') && (years_of_service < 5))
        printf("Your salary is 100000");
    else if ((gender == 'F' || gender == 'f') && (years_of_service >= 5))
        printf("Your salary is 200000");
    else if ((gender == 'F' || gender == 'f') && (years_of_service < 5))
        printf("Your salary is 150000");
    else
        printf("Invalid input");

    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let gender = prompt("Enter Gender (M for Male, F for Female):");
let years = Number(prompt("Enter Years of Service:"));
if ((gender === 'M' || gender === 'm') && years >= 5) {
    document.write("Your salary is 150000");
} else if ((gender === 'M' || gender === 'm') && years < 5) {
    document.write("Your salary is 100000");
} else if ((gender === 'F' || gender === 'f') && years >= 5) {
    document.write("Your salary is 200000");
} else if ((gender === 'F' || gender === 'f') && years < 5) {
    document.write("Your salary is 150000");
}
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
i.take a number n as an input.
ii.print n even numbers.
iii.print the sum of those even numbers.
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
C Program:
CSource Code
#include <stdio.h>
int main()
{
    int a, n, sum = 0, b = 2;
    printf("Enter number of even numbers required: ");
    scanf("%d", &n);
    for (a = 1; a <= n; a++)
    {
        printf("\n%d", b);
        sum += b;
        b += 2;
    }
    printf("\nSum of these numbers is %d", sum);
    return 0;
}
2025 Syllabus JavaScript Equivalent:
JAVASCRIPTSource Code
let n = Number(prompt("Enter number of even numbers required:"));
let sum = 0, b = 2;
for (let a = 1; a <= n; a++) {
    document.write(b + "<br>");
    sum += b;
    b += 2;
}
document.write("Sum of these numbers is " + sum);
Q.6aExtended Response Questions (ERQs)
Out of 2025 Syllabus6 Marks • Level Understanding
Question Text
EITHER (a):
i.Describe authentication and authorisation. (2 Marks)
ii.Describe TWO methods for Two Factor Authentication (2FA). (4 Marks)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
i. Authentication vs. Authorisation (2 Marks)
•Authentication (1 Mark): The process of verifying the identity of a user, device, or system before granting access (e.g., verifying a username and password, PIN, access card, or biometric scan).
•Authorisation (1 Mark): The process of determining what permissions, privileges, or resources an already-authenticated user is allowed to access or perform (e.g., read-only vs. administrator access).
ii. Two Methods for Two-Factor Authentication (2FA) (4 Marks)
1.Password/PIN + One-Time Password (SMS / Authenticator App OTP) (2 Marks): Combines something the user knows (account password) with something the user has (a time-sensitive verification code sent to their registered mobile phone or generated by an authenticator app).
2.Access Card + Biometric Scan / PIN (2 Marks): Combines something the user has (a physical smart card / ATM card) with something the user is (fingerprint or facial recognition scan) or knows (confidential PIN) to grant secure access to banking or restricted facilities.
Q.6bExtended Response Questions (ERQs)
Out of 2025 Syllabus6 Marks • Level Understanding
Question Text
OR (b): Describe the following types of hackers:
i.White Hat Hacker (2 Marks)
ii.Black Hat Hacker (2 Marks)
iii.Green Hat Hacker (2 Marks)
✓ BETTER RESPONSE (SOLVED MODEL ANSWER)Full Marks (6/6)
Types of Hackers (6 Marks)
1.White Hat Hacker (2 Marks): Also known as ethical hackers, these cybersecurity professionals are authorised by organisations to perform penetration testing, identify security vulnerabilities, and fix system weaknesses before malicious attackers can exploit them.
2.Black Hat Hacker (2 Marks): Malicious cybercriminals who break into computer systems and networks without authorisation to steal sensitive data, extort money (ransomware), distribute malware, or damage systems for personal or financial gain.
3.Green Hat Hacker (2 Marks): Amateur or novice hackers ('newbies') who are new to the hacking world, lack advanced technical expertise, and are eager to learn hacking techniques and tools from experienced hackers in online communities.