0% found this document useful (0 votes)
12 views

Class 12 computer

The document outlines the selection examination for Computer Science for Class XII at Calcutta Public School for the academic year 2024-25. It includes details about the examination structure, time allocation, and marks distribution, along with a series of questions covering various topics in computer science. Candidates are required to answer all questions in Part I and select six questions from Part II across three sections.

Uploaded by

Anuska
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Class 12 computer

The document outlines the selection examination for Computer Science for Class XII at Calcutta Public School for the academic year 2024-25. It includes details about the examination structure, time allocation, and marks distribution, along with a series of questions covering various topics in computer science. Candidates are required to answer all questions in Part I and select six questions from Part II across three sections.

Uploaded by

Anuska
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Calcutta Public School

Selection Examination 2024-25


Computer Science (Paper 1)
Class XII
Time: 3 hours Marks: 70

(Candidates are allowed additional 15 minutes for only reading the paper.
They must NOT start writing during this time.)
---------------------------------------------------------------------------------------------------------------------------
Answer all questions in Part I (compulsory) and six questions from Part II,
choosing two questions from Section-A, two from Section-B and two from Section-C.
All working including rough work should be done on the same sheet as
the rest of the answer.
The intended marks for questions or parts of questions are given in brackets [ ].
---------------------------------------------------------------------------------------------------------------------------
PART I (20 Marks)
Answer all questions
While answering questions in this part, indicate briefly your working and reasoning wherever required.

Question 1:
i. Assume int [ ] [ ] x = { {8,9} , {5,6,7},{1,2,3,4}}, what are x[0].length, x[1].length, and [1]
x[2].length ?
(a) 2, 3 and 3
(b) 2, 3 and 4
(c) 3, 3 and 3
(d) 2, 2 and 2
ii. Assertion (A) : Recursion utilises more memory as compared to iteration. [1]
Reason (R) : Absence of base case leads to infinite recursion.
Which one of the following options is correct?
(a) Both (A) and (R) are true, and (R) is the correct explanation for (A).
(b) Both (A) and (R) are true, but (R) is not the correct explanation for (A).
(c) (A) is true and (R) is false.
(d) (A) is false and (R) is true.
iii. What is the constructor's implicit return type? [1]
(a) none
(b) void
(c) same as constructor’s signature
(d) the class type itself
iv. Assertion (A): In Boolean Algebra, dual of the Boolean expression (A+B)’.1 is equal to 0. [1]
Reason (R): In Boolean Algebra, the complement of an OR operation is equal to the AND
operation of the complement of the individual variables.
(a) Both A and R are true, and R is the correct explanation of A.
(b) Both A and R are true, but R is not the correct explanation of A.
(c) A is true, but R is false.
(d) A is false, but R is true.
v. The reduced expression of the Boolean function F(P, Q) = A+A.B+A’ is: [1]
(a) A+B
(b) A’
(c) 0
(d) 1
vi. The Central Processing Unit (CPU) scheduling follows the principle of _________ data [1]
structure.

1
(a) Two-dimensional array
(b) Queue
(c) Linked list
(d) Stack
vii. Write the maxterm of F(W, X, Y, Z) when W = 0, X = 0, Y = 1 and Z = 1. [1]
viii. All methods declared in the interface are abstract. Where will the body of these abstract [1]
methods be defined?
ix. Verify if (AB’ + A’) is a Tautology, Contradiction, or a Contingency. [1]
x. State any one application for each of encoder and decoder. [1]

Question 2:
i. Convert the following infix notation to postfix notation. [2]
M/(N+O-P) + Q/R*T
ii. A square matrix M of order 6 is stored in the memory with each element [2]
requiring 2 bytes of storage. If the base address is 1012, find the address
of M[4][5] when the matrix is stored in Column Major Wise.
iii. Following method is a part of a class MyArray.
static int check(int m[ ], int i)
{
if (i<= 0)
{ return 0; }
return check(m, i-2 ) + m[i-1];
}
public static void main( )
{
int m[ ] = {1, 2, 3, 4};
int ans = check(m, m.length);
System.out.println(ans);
}
(a) Predict the output of the code considering there is no compilation error. Show [2]
the working.
(b) Considering the if condition is changed to if(i<0), how will it affect the output? [1]
iv. The following is a function of some class which checks if a positive integer is an Armstrong
number by returning true or false. (A number is said to be Armstrong
if the sum of the cubes of all of its digits is equal to the original number.) The
function does not use modulus (%) operator to extract digit. There are some
places in the code marked by ?1?, ?2?, ?3? which may be replaced by a statement/expression
so that the function works properly.
boolean ArmstrongNum(int N)
{
int sum = 0;
int num= N;
while(num>0)
{
int f=num/10;
int s= ?1?;
int digit = num-s;
sum+=?2?;
num= ?3?;}
if(N==sum)
return true;
else
return false;}
(a) What is the statement or expression at ?1? [1]

2
(b) What is the statement or expression at ?2? [1]
(c) What is the statement or expression at ?3? [1]

Part II (50 Marks)


Answer six questions in this part, choosing two questions from Section-A,
two from Section-B and two from Section-C
SECTION – A
Answer any two questions

Question 3:
(i) Given the Boolean function F(P,Q,R,S) = Σ(2,3,5,7,8,10,11,12,13,15).
(a) Reduce the above expression by using a 4-variable Karnaugh map, showing the [4]
various groups (i.e. octal, quads and pairs).
(b) Draw the logic gate diagram for the reduced expression using NAND gate only. [1]
Assume that the variables and their complements are available as inputs.
(ii) Draw the logic circuit diagram for the simplified form of the following expression: [2+1]
AB’C’+ AB’C + ABC
The circuit diagram should only contain one AND, one OR and one NOT gates.
(iii) Following is the circuit diagram of a full adder. Redraw the circuit diagram by [2]
adding missing logic gates.

Question 4:
Post pandemic, to encourage the tourism industry in India, the Ministry of Tourism
started a policy in which a tourist would be allowed to book a resort at a rebate, if the
any one of the following criteria matches:
• The tourist has an AADHAR card and has no criminal record.
OR
• The tourist is the government employee and has repeated the resort visit in a
span of six months.
OR
• The tourist has an AADHAR card and has repeated the resort visit in a span
of six months. The inputs are:
INPUTS
A The tourist has an AADHAR CARD
C The tourist has a criminal record
G The tourist is a government employee
V The tourist has repeated the resort visit in a span
of six months
(In all the above cases, 1 indicates yes and 0 indicates no.)

3
Output: F [1 indicates the tourist will be allowed to book the resort at rebate,
0 indicates not allowed rebate]
(i) Draw the truth table for the inputs and outputs given above and write the [5]
POS expression for F(A, C, G, V).
(ii) Reduce the above expression F(A, C, G, V) by using 4-variable Karnaugh [5]
map, showing the various groups (i.e. octal, quads and pairs).
Draw the logic gate diagram for the reduced expression. Assume that the
variables and their complements are available as inputs.

Question 5:
(i) Draw the logic circuit to decode the following binary number (0001, 0101, 0111, [5]
1000, 1010, 1100, 1110,1111) to its hexadecimal equivalents. Also state the
Hexadecimal equivalents of the given binary numbers.
(ii) Verify if the following proposition is valid using the truth table: [3]
(X ∧Y) =>Z = (Y =>Z) ∧ (X =>Y)
(iii) Write the cardinal Product-of-Sum (POS) expression for the sum and carry of a full [2]
adder.

SECTION-B
Answer any two questions
Each program should be written in such a way that it clearly depicts
the logic of the problem. This can be achieved using mnemonic name/comments
in the program.
(Flowcharts and Algorithms are not required)

Question 6:
A class LCM has been defined to find the Lowest Common Multiple of two integers. [10]
Some of the data members and member functions are given below:
Class name: LCM

Data members/instance variables:


n1 : to store an integer number
n2 : to store an integer number
large : integer to store the largest from n1, n2
sm : integer to store the smallest from n1, n2
l : to store lcm of two numbers

Methods / Member functions:


LCM( ) :default constructor to initialize data members with legal initial values
void accept( ) :to accept n1 and n2
int getLCM( ) :returns the lcm of n1 and n2 using the recursive technique
void display( ) :to print the numbers n1, n2 and lcm
Specify the class LCM giving details of the constructor( ), void accept( ), int getLCM()
and void display( ). Define a main ( ) function to create an object and call the member functions
accordingly to enable the task.

Question 7:
A class Symmetric is defined to check if a square matrix is symmetric or not. A symmetric matrix must [10]
be equal to it’s transposed matrix.
Matrix is obtained by interchanging the elements of the rows and columns.
Example: If size of the matrix = 3, then

4
11 5 7

5 13 9

7 9 20

Some of the members of the class are given below:


Class name: Symmetric

Data members/instance variable:


ar[][] : to store integers in the matrix.
m : integer to store the order of the matrix.

Methods/Member functions:
Symmetric(int mm) : parameterised constructor to initialise the data member
m = mm.
void fillarray() : to enter integer elements in the ar1 matrix.
Symmetric transpose(Symmetric M) : to create the transpose of the given matrix in object M and
store in the matrix of another object and return the resultant matrix.
void display() : checks whether the given matrix is a symmetric matrix or not by invoking the
transpose() and display an appropriate message.
Specify the class Symmetric giving details of the constructor(), void fillarray(),
Symmetric transpose() and void display().Define a main() function to create an object
and call the functions accordingly to enable the task.

Question 8:
Two words are called anagram of each other if both the words contain the same letters but they are [10]
arranged in different order. Following are the three pairs of the words which are anagrams of each
other.
cat, act
heart, earth
silent, listen

Design the class Anagram to input two words in lowercase and check if they are anagrams of each
other.

The member functions and data members of the class are given below:
Class Name : Anagram

Data members/instance variables:


s1, s2 : stores the two words in lowercase
l1,l2 : number of character in s1 and s2 respectively
Member functions :
Anagram(String ss1, String ss2) : parameterised constructor to assign the accepted values of s1 and
s2 to data member
void sort(char c[]) : to sort the characters in array c[ ] in ascending order using any sorting technique
boolean areAnagram(char[] str1, char[] str2) : to check if str1 and str2 are anagrams of each other
and to return true or false accordingly
void check() : to convert the two strings into two character arrays and to display the appropriate
message as shown in the sample output by calling the method areAnagram(char[] str1, char[] str2)
Specify the class Anagram giving details of the parameterised constructor,
void sort(char c[ ]), boolean areAnagram(char[] str1, char[] str2) and void check( ).
Create one object in the main( ) method and call all the methods appropriately.
Sample input :
Enter first word->earth
5
Enter second word->heart
Output : earth and heart are anagrams of each other

SECTION – C
Answer any two questions
Each program should be written in such a way that it clearly depicts the logic
of the program stepwise.
This can be achieved by using comments in the program and mnemonic name or pseudocodes
for algorithms. The algorithms must be written in general / standard
form, wherever required / specified.
(Flowcharts are not required)
Question 9: [5]
A library issues books on rental basis at a 2% charge on the cost price of the book per day. As per
the rules of the library, a book can be retained for 7 days without any fine. If the book is returned after
7 days, a fine will also be charged for the excess days as per the chart given below:
Number of excess days Fine per day (Rs.)
1 to 5 2.00
6 to 10 3.00
Above 10 5.00
A super class Library has been defined. Define a sub-class Compute to calculate the fine and
the total amount. The details of the members of both the classes are given below:
Class name : Library
Data members/instance variables:
name : to store the name of the book
author : to store the author of the book
p : to store the price of the book (in decimals)
Methods / Member functions:
Library( ... ) : parameterized constructor to assign values to the data members
void show( ) : displays the book details
Class name : Compute
Data members/instance variables:
d : number of days taken in returning the book
f : to store the fine (in decimals)
Methods / Member functions:
Compute( ... ) : parameterized constructor to assign values to the data members of both the classes
void fine( ) : calculates the fine for the excess days as given in the table above
void show( ) : displays the book details along with the number of days, fine and the total amount to
be paid.
Total amount is (2% of price of book * total no of days) + fine
Assume that the super class Library has been defined.
Using the concepts of Inheritance, specify the class Compute giving the details of constructor,
void fine ( ) and void show ( ) functions. The super class, main function
and algorithm need NOT be written.

Question 10:
WordPile is an entity which can hold a maximum of 20 characters. The restriction is that a character
can be added or removed from one end only.
Some of the members of classes are given below:
Class name: WordPile
Data members/instance variables:
ch[]: character array to hold the character elements
capacity: integer variable to store the maximum capacity
top: to point to the index of the topmost element

6
Member functions/methods:
WordPile (int cap): constructor to initialise the data members capacity = cap, top = -1
and create the WordPile
void pushChar(char v): adds the character to the top of WordPile if possible, otherwise output
a message “WordPile is full”
char popChar(): returns the deleted character from the top of the WordPile if possible, otherwise
it returns ‘\\’
(a) Specify the class WordPile giving the details of void pushChar(char) and [4]
char popChar() only. The main function and the constructor need not be written.
(b) What is the name of the entity described above and state one of its applications? [1]

Question 11:
i. A linked list is formed from the objects of the class: [2]
class Nodes
{
int num;
Node next;
}
Write an Algorithm OR a Method to print the sum of nodes that contains only odd integers
of an existing linked list. The method declaration is as follows:
void NodesCount (Nodes starPtr)
ii. Give the meaning of the following common expression in Big O notation: [1]
O(N)
O(N2)
iii. Answer the following questions from the diagram of a Binary Tree given below:

(a) Write the pre-order traversal of the above tree structure. [1]
(b) Name the leaf nodes of the tree. [1]

You might also like