CSS past papers · 2022

CSS 2022 Computer Science Combined Papers Past Paper

Download and review the CSS 2022 Computer Science Combined Papers Past Paper on CSS Vista, with archive details, related papers and a direct PDF link for examination preparation.

Paper details

Examination
CSS
Year
2022
Subject
Computer Science
Paper
Combined Papers
Subject type
Optional
Mode
Subjective

Browse the complete CSS Vista past-paper archive.

Questions recorded from this paper

These 12 question wordings are transcribed from CSS Vista’s structured Computer Science past-paper record for CSS 2022.

  1. Q4 · Introduction to Computing(a) Write a C++ program to check whether a string is palindrome or not. A palindrome is (12) a string, which when read in both forward and backward ways is the same, e.g., “radar”, “madam” etc. Note that these are only examples, you will take the string as an input from a user using the cin.getline function and your code should be general that can work on any input string. You are not allowed to use any string-related library function. (b) Write output of the following C++ code assuming that there is no error in the code: (8) #include <iostream.h> int main() { int a = 12, b = 25; cout << "a = " << a << endl; cout << "b = " << b << endl; cout << "a | b = " << (a | b) << endl; return 0; }
  2. Q6 · Introduction to Computing(a) Complete the following recursive function using C++ to calculate k raised to the (8) power n, i.e., kn. Use of any built-in (library) function is not allowed. int power(int k, int n) { // write your code here } (b) Compare and contrast the DES, AES, and RSA encryption algorithms. (8) (c) Write the time complexity of the following C++ code in terms of Big-O notation. (4) Assume that there is no error in the code. int isPrime (unsigned int n) // returns true if the argument value is prime and // false otherwise { for (unsigned int i = 2; (i * i) < n; i++) { // if i is a factor, then not prime if (n % i == 0) return 0; } // if we end loop without finding factor then // number must be Prime return 1; }
  3. Q5 · Creation(a) Define a class called Circle using C++. An object of the class Circle can be created (10) using any of the following ways (implement all the ways): (1) by default, the circle will be of radius 1 inch and centered at (0,0) (2) with a given value for radius, centered at (0,0) (3) by providing the center coordinates and the radius is assumed to be 1 (4) by providing the radius and the coordinates for the center (5) by providing another Circle object to initialize. In the main function (driver program), separately create 5 different objects of the Circle class using a different way of object creation (mentioned above) for each of them. (b) What is a virtual function in C++? Using an example, explain how does a virtual (10) function mechanism work.
  4. Q3 · Information Security/Privacy(a) Complete the C++ code below to find the number of distinct elements in an array in (8) O(n) time (linear time complexity) where “n” is the number of elements in the array. For example, if the array is {3,1,3,8,2,1,8,2}, the number of distinct elements is 4 (to be returned from the function below) as the distinct elements are {1,2,3,8}. All the elements of the array are in the range [1,100]. Also, n >> 100 (n is significantly greater than 100). int numDistinctElements(int[] array, int n) { int count = 0; // write your code here return count; } (b) Write a detailed note on the principles of Information Security/ Privacy. (6) (c) Write output of the following C++ code assuming that there is no error in the code: (6) int v1 = 55; int* p1 = &v1; int* p2; p2 = p1; *p1 = 20; cout << *p2 << endl; cout << v1 << endl;
  5. Q2 · computer engineering and bioinformatics(a) Using C++ write a function pattern (int n) that produces the following output. Pay (8) special attention to the spaces and clearly state the return type of the function. Note that the following is just an example; your solution should work for any input “n”. (b) Write the differences between Computer Science, Software Engineering, Information (6) Technology, Information Systems, Computer Engineering, and Bioinformatics. (c) Write output of the following C++ code assuming that there is no error in the code: (6) int ary[4] = {1,2,3,4}; int *p1 = ary + 3; cout << p1[-2] << endl; int *p2 = &p1[-2]; *p2 = 10; cout << ary[1] << endl;
  6. Q7 · Binary Search(a) The following function performs binary search on a given array of n numbers: (8) 1. int binarySearch (int x, int v[], int n) 2. { 3. int low, high, mid; 4. low = 0; 5. high = n – 1; 6. while (low < = high) 7. { 8. mid = (low + high )/2; 9. if (x < v[mid]) 10. high = mid – 1; 11. else if (x > v[mid]) 12. low = mid + 1 ; 13. else return mid; 14. } 15. return -1; 16. } Draw control flow graph for the above function. Also find its cyclomatic complexity. (b) What is the difference between white box (Glass Box) testing and black box testing? (6) Which of these testing techniques helps in identifying more errors in a system under evaluation? Explain. (c) Requirements can be specified using natural language specification. Write one user (6) requirement and one system requirement for the following function: Automatically highlight incorrect spelling mistakes in an MS Word document.
  7. Q8 · Syntax Analysis (Context-free grammars and their classification(a) Draw a finite automaton over ∑ = {0, 1} that accepts all binary strings starting and (8) ending with 0 (single-0 string counts). (b) Write a regular expression over ∑ = {0, 1} to represent a set of strings that begin with (6) 101 and end with 110. (c) Write a Context-Free Grammar (CFG) over ∑ = {0, 1} for the language of all binary (6) a b c strings of the form 0 1 0 where a+c=b. Roll Number
  8. Q4 · Cache Memory(a) Assume a pipeline with four stages: fetch instruction (FI), decode instruction and calculate (8) addresses (DA), fetch operand (FO), and execute (EX). Draw a diagram for a sequence of 7 instructions, in which the third instruction is a branch that is taken and in which there are no data dependencies. (b) A set associative cache consists of 64 lines, or slots, divided into 4-slot sets. Main memory (6) contains 4K blocks of 128 words each. Show the format of main memory addresses. (c) Why is DMA access to main memory given higher priority than CPU access to main memory? (6)
  9. Q5 · Reliable data transfer and TCP(a) Describe any one of the routing algorithms in detail, which is used to resolve the conflict (8) between path selections. (b) A company occupies four buildings on a campus. Each of these building has a 100 base T (6) network running to all the floors. The buildings form a square 100 meter on each side. The network must support 100 Mbps data transfer rate. What will be the proposed design solution under the given condition? (c) What is the main fault in TCP 3-way handshake which makes it a boon for attackers? (6) Many operating systems generally associate a “Backlog” parameter with a listening socket that sets cap on the number of TCBs simultaneously in SYN-RECEIVED state. Does this parameter solve the problem in TCP 3-way handshake?
  10. Q3 · Operating Systems Concepts(a) Consider the following snapshot of the system. (12) Using banker’s algorithm, determine whether the state is safe or unsafe. If the state is safe, illustrate the order in which the processes may complete. Otherwise, illustrate why the state is unsafe. (b) Give an account of different functions of Logical File System. (4) (c) What resources are used when a thread is created? How do they differ from those used (4) when a process is created?
  11. Q6 · Digital Image Processing(a) Find the reflection, , of each of the following Structuring Elements (SE). The dot indicates the (8) origin of the SE. (b) The R, G, and B component images of an RGB image have the horizontal intensity profiles shown in the following diagram. Show your working to identify color that a person would see in the (8) middle column of this image? (c) How Digital Image Processing and Computer Vision are related? Discuss.
  12. Q7 · Web Application Development Methodologies(a) Explain 3-tier web application architecture. (8) (b) Write the jQuery code to slide elements up and down. Also write the code to fade the elements in (6) and out of visibility. Use HTML, CSS, and jQuery. (c) What is web application promotion? Discuss some of the common webvertising methods. (6)

Topic-wise Computer Science past-paper analysis.