Computer Science Paper I Past Paper 2020

The Computer Science Paper I Past Paper 2020 runs from gates to graphs. Q.2 covers logic gates, Fibonacci and abstract classes. Q.3 covers ports, a citizen portal interface and TCP against UDP. Q.4 covers complex numbers, encapsulation and numbers to words. Q.5 covers a student records class diagram and C++ programs. Q.6 covers longest paths, complexity and shortest paths. Q.7 covers token counting, state tables and automata. Q.8 closes with P versus NP, social graphs and heuristics. This file holds the Part-II sheet only.

What this paper contains

  • This file carries Part-II (the descriptive part) of the paper.
  • Part-II — attempt ONLY FOUR questions, TWO from EACH of two sections; each question carries 20 marks (Part-I holds the 20 MCQs, per the printed header)

Part-II questions

SECTION-A

Q.2 — (a) Write a C/C++ program which implements binary logical ‘AND’, ‘OR’ and ‘NOT’ gates. The program takes binary numbers and desired logical gate as inputs and outputs the desired output of the gate. (8)
(b) Write a C/C++ program which inputs a number from a user and prints Fibonacci series up to the number. (7)
(c) Explain the concept of abstract class with an example (5) (20)

Q.3 — (a) Write standard ports for following services HTTP, FTP, SMTP, HTTPS, DNS. (4)
(b) Design an appropriate interface for citizen portal mobile application. The interface should contain different features which are part of the portal application. The Interface may contain different screens to support these features. (8)
(c) If you are transferring a file over the Internet, would you prefer TCP or UDP as the underlying protocol. Explain (4)
(d) If you are transferring live audio in real-time over the Internet, would you prefer TCP or UDP as the underlying protocol. Explain. (4) (20)

Q.4 — (a) Write a program to perform mathematical operations of addition, subtraction and multiplication on complex numbers. Each operation should be supported by a separate method. (8)
(b) How object encapsulation is useful? Explain. (4)
(c) Write a program to convert numbers into words. For instance, if the user types 123, the program should give output one hundred and twenty three. The program should continue functioning until the user types quit. (4) (20)
(Note: part marks as printed sum to 16; the question carries 20 marks as printed in the sheet header pattern. The marks above are exactly as printed.)

Q.5 — A university maintains records for students, Faculty, and academic record. Following three classes are part of the system
Student (ID, Name, Age, Address, Contact, Program, CGPA)
Teachers (ID, Name, Age, Address, Highest Degree, Subjects, Salary)
Courses (Semester, Course Code, Student ID, Teacher ID, Grade). All the data is stored in files
(a) Draw a class diagram to represent the three classes and their relationships (5)
(b) Write C++ programs to compute following: (15)
i. Add a student ii. Add a course
iii. Find a student with respect to CGPA iv. Add a Teacher
v. Update a student (20)

SECTION-B

Q.6 — John rides a Van service from new square (S) to the city harbor (T). The van service charges Rs 10 per Km. There are numerous routes between the two points.
(a) In order to rip off his customers, John always wanted to use the longest path. To find the longest path, John evaluates all the possible paths and selects the longest path. Write an algorithm to select the longest path using this approach. (7)
(b) Compute the complexity of this algorithm and determine that whether it is in P, NP, or NP-complete. (3)
(c) Write an algorithm to find a minimum distance between ‘S’ and ‘T’. (7)
(d) Derive the complexity of this algorithm. (3) (20)

Q.7 — (a) How many tokens are there in in this C code : (5)
printf(“k = %d, &k = %x”, k, &k);
(b) Create State Transition Table from the following graph (5)
(Graph as printed on the sheet.)
(c) Draw Finite State Automata which accepts following input. (4)
i. JIM ii. JMI
iii. JJIIM iv. JJMMII
(d) Determine which of these inputs are valid for the FSM shown below: (6)
(FSM as printed on the sheet.)
i. aaaaa
ii. ababa
iii. abcabc
iv. abccba
v. acbcd
vi. acbcdcd (20)

Q.8 — (a) Is P = NP? Comment (4)
(b) Suppose you are representing a social network (such as facebook) as a graph. Devise an algorithm through which you can determine friends of friends. (7)
(c) Explain the complexity of this algorithm (5)
(d) Optimal problems are generally NP hard problems. Is it appropriate to use heuristics based approaches? (4) (20)

Computer Science Paper I Past Paper 2021 · All Computer Science Past Papers · Computer Science Paper I Past Paper 2019