0% found this document useful (0 votes)
52 views7 pages

Computer Xii Prelims 24-25

The document outlines the structure and content of a pre-board examination for Class XII Science students at Raymond Memorial Higher Secondary School, specifically for the Computer Science Theory paper. It includes details such as the maximum marks, time allowed, and specific instructions for answering questions across various sections. The paper consists of multiple-choice questions, programming tasks, and theoretical questions related to computer science concepts.

Uploaded by

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

Computer Xii Prelims 24-25

The document outlines the structure and content of a pre-board examination for Class XII Science students at Raymond Memorial Higher Secondary School, specifically for the Computer Science Theory paper. It includes details such as the maximum marks, time allowed, and specific instructions for answering questions across various sections. The paper consists of multiple-choice questions, programming tasks, and theoretical questions related to computer science concepts.

Uploaded by

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

RAYMOND MEMORIAL HIGHER SECONDARY SCHOOL

PRE-BOARD EXAMINATION 2024-2025


CLASS – XII SCIENCE
COMPUTER SCIENCE PAPER 1 (THEORY)
------------------------------------------------------------------------------------------------
Maximum Marks: 70
Time allowed: Three Hours
Candidates are allowed an additional 15 minutes for only reading the paper.

They must NOT start writing during this time.

Answer all questions in Section A, Section B and Section C.

While answering questions in Sections A and B, working and reasoning may be indicated briefly.
The intended marks for questions or parts of questions are given in brackets. [ ]
All working, including rough work, should be done on the same sheet as the rest of the
answer.
******************************************************************************************

PART I (20 Marks)

Answer all questions. While answering questions in this Part, indicate briefly your working
and reasoning wherever required.

Question 1
(i) The compliment of the Boolean expression Aꞌ • (B • Cꞌ + Bꞌ • C) [1]
(a) Aꞌ • (B+C+Bꞌ +C) (b) A+ (B+Cꞌ) •(B+Cꞌ) (c) A+(Bꞌ +C) • (B+Cꞌ) (d) Aꞌ • (Bꞌ +Cꞌ +Bꞌ •C)

(ii) Given below are two statements marked Assertion and Reason. Read the two statements
carefully and choose the correct option.
Assertion: Recursion utilises more memory as compared to iteration.
Reason: Time complexity of recursion is higher due to the overhead of maintaining the function call
stack. [1]
(a) Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
(c) Assertion is true and Reason is false.
(d) Assertion is false and Reason is true.

(iii) According to the Principle of duality, the Boolean equation (A ꞌ + B) • (1 + B) = A ꞌ + B will be


equivalent to: [1]
(a) (A + Bꞌ) • (0 + B) = A + Bꞌ
(b) (Aꞌ • B) + (0 • B) = Aꞌ • B
(c) (Aꞌ • B) + (0 • B) = Aꞌ + B
(d) (Aꞌ + B) • (0 + B) = Aꞌ + B
(iv) Distributive law states that: [1]
(a) A + B • C = (A + B) • (A +C)
(b) A + ( A • B) = A
(c) A • (B + C) = (A • B) + (B • C)
(d) A + B • C = A • B + A • C

(v) The complement of the reduced expression of F(A,B) = Σ (0,1,2,3) is: [1]
(a) 1 (b) A • B (c) 0 (d) Aꞌ + Bꞌ

(vi) Study the given propositions and the statements marked Assertion and Reason that follow it.
Choose the correct option on the basis of your analysis. [1]
p = I am a triangle
q = I am a three-sided polygon
s1 = p → q
s2 = q → p
Assertion: s2 is converse of s1
Reason: Three-sided polygon must be a triangle.
(a) Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
(c) Assertion is true and Reason is false.
(d) Assertion is false and Reason is true.

(vii) Given below are two statements marked Assertion and Reason.
Read the two statements carefully and choose the correct option. [1]
Assertion: In Java, the String class is used to create and manipulate strings, and it is immutable.
Reason : Immutability ensures that once a String object is created, its value cannot be changed.
(a) Both Assertion and Reason are true and Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true but Reason is not the correct explanation for Assertion.
(c) Assertion is true and Reason is false.
(d) Assertion is false and Reason is true.
(viii) Consider the following statement written in class Circle where pi is its data member.
static final double pi = 3.142;
Which of the following statements are valid for pi? [1]
I. It contains a common value for all objects class Circle.
II. Its value is non-changeable.
III. At a time two access modifiers, static and final, cannot be applied to a single data member pi.
(a) I and II (b) II and III (c) I and III (d) Only III

(ix) For Big O notation, state the difference between O(n) and O(n2). [1]

(x) A full adder needs five gates and those are 3 AND gates, 1 OR gate and 1 XOR gate. When a full
adder is constructed using 2 half adders, it also requires 5 gates. State the names along with the
quantity those gates. [1]

Question 2

(i) Convert the following infix notation to prefix form. ( A – B ) / C * ( D + E ) [2]


(ii) A matrix M[-6….10, 4…15] is stored in the memory with each element requiring 4 bytes of
storage. If the base address is 1025, find the address of M[4][8] when the matrix is stored in column
major wise. [2]

(iii) The following function getIt() is a part of some class. Assume x is a positive integer, f is the lower
bound of arr[ ] and l is the upper bound of the arr[ ]. Answer the questions given below along with
dry run/working.

public int getIt(int x,intarr[],int f,int l)


{
if(f>l)
return -1;
int m=(f+l)/2;
if(arr[m]<x)
return getIt(x,m+1,l);
else if(arr[m]>x)
return getIt(x,f,m-1);
else
return m;
}
(a) What will the function getIt( ) return if arr[ ] = {10,20,30,40,50} and x=40? [2]
(b) What is function getIt( ) performing apart from recursion? [1]

(iv) The following is a function of class Armstrong. This recursive function calculates and returns the
sum of the cubes of all the digits of num, where num is an integer data member of the class
Armstrong. [A number is said to be Armstrong if the sum of the cubes of all its digits is equal to the
original number]. 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.

public int sumOfPowers(int num)


{
if (num == 0)
return ?1?;
int digit = ?2?;
return (int) Math.pow(digit, 3) + ?3?;
}
(a) What is the expression or statement at ?1? [1]
(b) What is the expression or statement at ?2? [1]
(c) What is the expression or statement 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
(Marks – 10x2=20)

Question no 3.
a) Given the Boolean function : F(A,B,C,D ) = Σ(0,1,2,3,4,5,7,8,9,10,12,13,15)
i) Reduce the above expression by using 4-variable K-map, showing the various groups (i.e. octal, quads and pairs). [ 4 ]
ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as
inputs. [ 1 ]
b) Given the Boolean Function :F(P,Q,R,S) = Π(0,1,3,5,6,8,9,10,11,12,14,15)
i) Reduce the above expression by using 4-variable K-map, showing the various groups (i.e. octals, quads and pairs). [ 4 ]
ii) Draw the logic gate diagram of the reduced expression. Assume that the variables and their complements are available as
inputs. [ 1 ]

Question no 4. [5x2=10]
The principal of a school intends to select students for admission to Class XI on the following criteria:

· Student is of the same school and has passed the Class X Board Examination with more than 60% marks.
OR
· Student is of the same school, has passed the Class X Board Examination with less than 60% marks but has taken active
part in co-curricular activities.
OR
· Student is not from the same school but has either passed the Class X board Examination with more than 60% marks or has
participated in Sports at the national level.

The inputs are :


INPUTS
S Student is of the same school
P Has passed the Class X Board Examination with more than 60% marks.
C Has taken active part in co-curricular activities.
T Has participated in sports at the National Level.
Output :-
X – Denotes admission status [ 1 indicates granted and 0 indicates refused in all the cases.]
a) Draw the truth table for the inputs and outputs given above and write the SOP expression.
b) Reduce X(S,P,C,T) using Karnaugh’s map.
Draw the logic gate diagram for the reduced SOP expression for X(S,P,C,T) using AND and OR
gate. You may use gates with two or more inputs. Assume that the variable and their
complements are available as inputs.
Question no 5.
a) Define multiplexer and state one of its uses. Draw the logic gate diagram for 4:1Multiplexer. [ 4 ]

b) State how a half adder is different from a full adder. Also give their respective uses. [3]

c) Minimize the following expression using Boolean laws: Q(Q’+P).R.(Q+R) [3]

Also draw the logic gate for the reduced Boolean expression.

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 by using mnemonic names and comments in the program.

(Flowcharts and Algorithms are not required.)The programs must be written in Java

Question no 6.

A happy number is a number in which the eventual sum of the square of the digits of the number is equal to
1.
Example:28=2^2+8^2=4+64=68
68=6^2+8^2=36+64=100
100=1^2+0^2+0^2=1 +0+0=1
Hence,28 is a happy number.
Example:12 =1^2+2^2=1+4=5
Hence, 12 is not a happy number.

Design a class Happy to check if a given number is a happy number.Some of the member of the class are
given below:
Classname:Happy
Data members/ instance variables:
n: stores the number
Member functions:
Happy(): constructor to assign 0 to n
void getnum(int nn): to assign the parameter value to the number n=nn
int sum_sq_digits(int x): returns the sum of the square of the digit of the number x. using the recursive
technique
void ishappy(): checks if the given number is a happy number by calling the function sum_sq_digits (int) and
displays an appropriate message
Specify the class Happy giving details of the constructor( ). void getnum(int) , int sum_sq_digits(int) and void
ishappy() . Also define a main() functionc to create an object and call the methods to check for happy
number.

Question no 7.

A class Composite contains a two dimensional array of order [m x n]. The maximum value possible for both ‘m’
and ‘n’ is 20. Design a class Composite to fill the array with the first (m x n)composite numbers in column wise.
The details of the members of the class are given below:[10]
Class name: Composite
Data members/instance variables:
arr[ ] [ ] : stores the composite numbers column wise
M : integer to store the number of rows
N : integer to store the number of columns
Member functions/methods:
Composite(int mm, int nn ) : to initialize the size of the matrix m=mm and n=nn
int isComposite( int p ) : returns 1 if number is composite otherwise returns 0
void fill ( ) : to fill the elements of the array with the first (m × n)composite numbers in column wise
void display( ):displays the array in a matrix form
Specify the class Composite giving details of the constructor(int,int), int isComposite(int), voidfill( ) and void
display( ). Define a main( ) function to create an object and call the functions accordingly to enable the task.

Question no 8.
A class SwapSort has been defined to perform string related operations on a word input. Some of the members
of the class are as follows:
Class name: SwapSort
Data members/instance variables:
wrd: to store a word
len: integer to store length of the word
swapwrd: to store the swapped word
sortwrd: to store the sorted word
Member functions/methods:
SwapSort( ):default constructor to initialize data members with legal initial values
void readword( ):to accept a word in UPPER CASE
void swapchar( ):to interchange/swap the first and last characters of the word in ‘wrd’ and stores the new
word in ‘swapwrd’
void sortword( ):sorts the characters of the original word in alphabetical order and stores it in ‘sortwrd’
void display( )displays the original word, swapped word and the sorted word
Specify the class SwapSort, giving the details of the constructor( ), void readword( ), void swapchar( ), void
sortword( ) and void display( ). Define the main( ) function to create an object and call the functions
accordingly to enable the task.

. SECTION–C

(Write any two question) [5x2=10]

Question no 9.

a) super class Number is defined to calculate the factorial of a number. Define a sub class Series to find the
sum of the series S = 1! + 2! + 3 ! + 4!+ . . . . . . . . . … . ..+n!
The details of the members of both the classes are given below:
Class name:Number
Data member/instance variable:
n:to store an integer number
Member functions/methods:
Number(int nn):parameterized constructor to initialize the data member n=nn
int factorial (int a):returns the factorial of a number (factorial of n = 1x 2x 3 x . . . . . . . . . x n)
void display():displays the data members
Class name:Series
Data member/instance variable:
sum:to store the sum of the series
Member functions/methods:
Series( . . .):parameterized constructor to initialize the data members of both the classes
void calsum( ):calculates the sum of the given series
void display( ):displays the data members of both the classes
Assume that the super class Number has been defined. Using the concept of inheritance, specify the class
Series giving the details of the constructor( . . .), void calsum( ) and void display( ).
The super class, main function and algorithm need NOT be written.

b) Register is an entity which can hold a maximum of 100 names. The register enables the user to add and
remove names from the top most end only.
Define a class Register with the following details:
Class name:Register
Data members / instance variables:
stud[ ]:array to store the names of the students
cap:stores the maximum capacity of the array
top: to point the index of the top end
Member functions:
Register (int max):constructor to initialize the data member cap = max, top = -1 and create the string array
void push(String n):to add names in the register at the top location if possible, otherwise display the message
“OVERFLOW”
String pop():removes and returns the names from the top most location of the register if any, else returns “$”
void display():displays all the names in the register
(a)Specify the class Register giving details of the functions void push(String) and String pop( ). Assume that the
other functions have been defined .
The main function and algorithm need NOT be written.

c)

(i) With the help of an example, briefly explain the constant factor in time complexity. [2]

Answer the following questions from the diagram of a Binary Tree given below: [3]

(Ii) Write the inorder traversal of the above tree structure.


(iii) State the height of the tree, if the root is at level 0(zero).
(iv) List the leaf nodes of the tree.

***************************************************************************
***************************************************************************

You might also like