- (a)Discuss the future of Information Technology (IT) in Pakistan and its huge impact on all our daily lives.
- (b)Discuss the difference between a computer virus, a trojan and a worm.
- (c)Discuss the pros and cons of LaTeX in comparison to other document processors.
Computer Science, Paper I
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 →Section A
(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.
(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.
- (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.
- (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.
- (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.
Section B
(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.
- (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
- (b)Write an algorithm that implements binary search recursively. Does this version have any advantages or disadvantages compared to the non-recursive version?
- (c)Write an algorithm that deletes a specified cell from a doubly linked list. Draw a picture that shows the process graphically.
- (a)Discuss the phases of project management including conception and initiation, project planning, project execution, performance/monitoring, and project close.
- (b)What are the different types of test design techniques? When would you use these types of test design techniques?
- (c)Exemplify the difference between Quality Assurance, Quality Control, and Testing?
Write Regular Expression(s) for the following:
- (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)
Related papers
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.