Prep Right
Questions › CSS › Computer Science › 2024
FPSC · CSS 2024

Computer Science, Paper I

100 marks · 3 hours · 7 questions · official PDF, 3 pages
This paper Computer Science · all yearsQ. 2 · Discuss the future of Information…Q. 3 · (a) Write a program that…Q. 4 · Write a program that displays…Q. 5 · (a) Show the output of…Q. 6 · For the following data sets,…Q. 7 · Discuss the phases of project…Q. 8 · Write Regular Expression(s) for the…With this paperPart-I MCQs20Official PDF3 pp← 20232024 →
3 hours · questions hide until you reveal them

Section A

Q. 2
  1. (a)Discuss the future of Information Technology (IT) in Pakistan and its huge impact on all our daily lives. [6]
  2. (b)Discuss the difference between a computer virus, a trojan and a worm. [6]
  3. (c)Discuss the pros and cons of LaTeX in comparison to other document processors. [8]
(20)
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.

(b) Write pseudocode OR C-language script for the following expression.

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.

Checked against official paper
(20)
Q. 4
  1. (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]
  2. (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]
  3. (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 has 29 days. If the user entered month 3 and year 2015, the program should display that March 2015 had 31 days. [8]
(20)

Section B

Q. 5

(a) Show the output of the following code?

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.

(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.

Checked against official paper
(20)
Q. 6
  1. (a)For the following data sets, which sorting algorithms would work well, and which would not? 10 floating-point values 1,000 integers 1,000 names 100,000 integers with values between 0 and 1,000 100,000 integers with values between 0 and 1 billion 100,000 names 1 million floating-point values 1 million names 1 million integers with uniform distribution 1 million integers with non-uniform distribution [8]
  2. (b)Write an algorithm that implements binary search recursively. Does this version have any advantages or disadvantages compared to the non-recursive version? [6]
  3. (c)Write an algorithm that deletes a specified cell from a doubly linked list. Draw a picture that shows the process graphically. [6]
(20)
Q. 7
  1. (a)Discuss the phases of project management including conception and initiation, project planning, project execution, performance/monitoring, and project close. [6]
  2. (b)What are the different types of test design techniques? When would you use these types of test design techniques? [6]
  3. (c)Exemplify the difference between Quality Assurance, Quality Control, and Testing? [8]
(20)
Q. 8

Write Regular Expression(s) for the following:

  1. (i)For date Format of standard e.g. (10.03.2024 | 12/30/2023 | 01/01/2022) [5]
  2. (ii)Write a Regular Expression that will match URL e.g. (http://example.edu.pk) [5]
  3. (iii)Write a Regular Expression that will match an IP address. e.g. 192.168.0.1 [5]
  4. (iv)Write a Regular Expression that will match an email address. e.g. (abc@example.com) [5]
(20)

Related papers

Computer Science 2000Computer Science 2002Computer Science 2003Computer Science 2004Computer Science 2005Computer Science 2006Computer Science 2009Computer Science 2010Computer Science 2011Computer Science 2012Computer Science 2013Computer Science 2015Computer Science 2016Computer Science 2017Computer Science 2018Computer Science 2018Computer Science 2019Computer Science 2019Computer Science 2020Computer Science 2020Computer Science 2021Computer Science 2021Computer Science 2022Computer Science 2022Computer Science 2023Computer Science 2023Computer Science 2024Computer Science 2025Computer Science 2025Computer Science 2026Computer Science 2026Accountancy & Auditing 2024Accountancy & Auditing 2024Agriculture & Forestry 2024Applied Mathematics 2024Arabic 2024Balochi 2024Business Administration 2024Chemistry 2024Chemistry 2024Comparative Study of Major Religions 2024Computer Science 2024Constitutional Law 2024Criminology 2024Current Affairs 2024Economics 2024Economics 2024English Essay 2024English Literature 2024English (Précis & Composition) 2024Environmental Sciences 2024European History 2024Gender Studies 2024General Science & Ability 2024Geology 2024Governance & Public Policies 2024History of Pakistan & India 2024History of USA 2024International Law 2024International Relations 2024International Relations 2024Islamic History & Culture 2024Islamic Studies 2024Journalism & Mass Communication 2024Law 2024Muslim Law & Jurisprudence 2024Pakistan Affairs 2024Persian 2024Physics 2024Physics 2024Political Science 2024Political Science 2024Psychology 2024Public Administration 2024Punjabi 2024Statistics 2024Town Planning & Urban Management 2024

About this paper

The 2024 CSS Computer Science paper set by the Federal Public Service Commission. Question wording only; questions marked “Not yet checked” have not been compared with the official paper yet. Open the official paper beside the questions to check any of them.

Disclaimer Prep Right is independent and not affiliated with FPSC.