Skip to content
All Computer Science Paper I papers

CSS past paper

CSS Computer Science Paper I Past Paper 2024

CSS Computer Science Paper I 2024 carries 100 marks over 3 hours. It has 7 questions.

Marks
100
Time
3 hours
Questions
7

How to attempt: Attempt ONLY FOUR questions from PART-II, by selecting TWO questions from EACH SECTION. ALL questions carry EQUAL marks.

Questions

Question 1 (Part I) is the paper's MCQs, which are not reproduced here.

SECTION-A

  1. Q. 2
    • (a)
      Discuss the future of Information Technology (IT) in Pakistan and its huge impact on all our daily lives.
      (6)
    • (b)
      Discuss the difference between a computer virus a trojan and a worm?
      (6)
    • (c)
      Discuss the pros and cons of LaTeX in comparison to other document processors.
      (8)
  2. Q. 3
    • (a)
      Write a program that prompts the user to enter a letter grade A, B, C, D, or F and displays its corresponding numeric value 4, 3, 2, 1, or 0.
      (6)
    • (b)
      Write pseudocode OR C-language script for the following expression.
      (6)
      a⃗⋅b⃗=∑i=1naibi=a1b1+a2b2+…+anbn\vec{a} \cdot \vec{b} = \sum_{i=1}^{n} a_{i}b_{i} = a_{1}b_{1} + a_{2}b_{2} + \ldots + a_{n}b_{n}
    • (c)
      Write a version of Breadth First Search (BFS) that finds the distances from the start node to each of the others, rather than the actual paths.
      (8)
  3. Q. 4
    • (a)
      Write a program that displays the area and perimeter of a rectangle with the width of 4.5 and height of 7.9 using the following formula: area = width * height.
      (6)
    • (b)
      Write a program that reads a Celsius degree from the console, then converts it to Fahrenheit and displays the result. The formula for the conversion is as follows: Fahrenheit = (9 / 5) * Celsius + 32.
      (6)
    • (c)
      Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2024, the program should display that February 2024 had 29 days. If the user entered month 3 and year 2015, the program should display that March 2015 had 31 days.
      (8)

SECTION-B

  1. Q. 5
    • (a)
      Show the output of the following code?
      (6)
      public class Test {
      public static void main(String[] args) {
       Double x = 3.5;
       System.out.println(x.intValue());
       System.out.println(x.compareTo(4.5));
       }
      }
    • (b)
      Illustrate the difference between overriding and overloading by the piece of pseudocode or program.
      (6)
    • (c)
      How do you prevent a class from being extended? How do you prevent a method from being overridden? Exemplify with simple piece of code.
      (8)
  2. Q. 6
    • (a)
      For the following data sets, which sorting algorithms would work well, and which would not?
      (8)
      • (a)
        10 floating-point values
      • (b)
        1,000 integers
      • (c)
        1,000 names
      • (d)
        100,000 integers with values between 0 and 1,000
      • (e)
        100,000 integers with values between 0 and 1 billion
      • (f)
        100,000 names
      • (g)
        1 million floating-point values
      • (h)
        1 million names
      • (i)
        1 million integers with uniform distribution
      • (j)
        1 million integers with non-uniform distribution
    • (b)
      Write an algorithm that implements binary search recursively. Does this version have any advantages or disadvantages compared to the non-recursive version?
      (6)
    • (c)
      Write an algorithm that deletes a specified cell from a doubly linked list. Draw a picture that shows the process graphically.
      (6)
  3. Q. 7
    • (a)
      Discuss the phases of project management including conception and initiation, project planning, project execution, performance/monitoring, and project close.
      (6)
    • (b)
      What are the different types of test design techniques? When would you use these types of test design techniques?
      (6)
    • (c)
      Exemplify the difference between Quality Assurance, Quality Control, and Testing?
      (8)
  4. Q. 8
    Write Regular Expression(s) for the following (5 each)
    (20)
    • (I)
      For date Format of standard e.g. (10.03.2024 | 12/30/2023| 01/01/2022)
    • (II)
      Write a Regular Expression that will match URL e.g. (http://example.edu.pk)
    • (III)
      Write a Regular Expression that will match an IP address. e.g. 192.168.0.1
    • (IV)
      Write a Regular Expression that will match an email address. e.g. (abc@example.com)
  1. Part-II is to be attempted on the separate Answer Book.
  2. Attempt ONLY FOUR questions from PART-II, by selecting TWO questions from EACH SECTION. ALL questions carry EQUAL marks.
  3. All the parts (if any) of each Question must be attempted at one place instead of at different places.
  4. Write Q. No. in the Answer Book in accordance with Q. No. in the Q.Paper.
  5. No Page/Space be left blank between the answers. All the blank pages of Answer Book must be crossed.
  6. Extra attempt of any question or any part of the question will not be considered.