STEM WORLD SCHOOL
SESSION: 2025-26
HALF YEARLY EXAMINATION
COMPUTER SCIENCE
CLASS- 11
Maximum Marks: 70
Time allowed: 3 hours
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during first 15 minutes.
This time is to be spent in reading the question paper.
The time given at the head of this Paper is the time allowed for writing the answers.
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 reason wherever
required.
Question 1
(i) The complement of the Boolean expression (P’Q+PQ’) . (P’+Q’) is: [1]
a) (P.Q’).(P’+Q)+(P+Q)
b) (P+Q’).(P’+Q)+(P.Q)
c) (P+Q’).(P’+Q)+(P.Q)
d) (P+Q’).(P’+Q)+(P’+Q’)
(ii) Assertion (A): The Equivalence expression is p <-> q.
Reason (R): An Equivalence Statement always gives the final result as
Contingencies. [1]
(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.
(iii) According to the Principle of Duality, the Boolean equation (X’.Y’+1+X).Y=1
will be equivalent to: [1]
(a) (X+Y’).1.X+Y=1
Page 1 of 9
(b) (X’+Y.0.X)+Y=1
(c) (X’+Y’.0.X)+Y=0
(d) (X’+Y’).0.X+Y=0
(iv) Absorption law states that [1]
a) A+(A.B) = A
b) A.(A+B) = A+A.B
c) A.B + A.C = A.(B+C)
d) (A+B) = (B+A)
(v) Differentiate between Tautology and Contradiction [1]
(vi) Perform hexadecimal subtraction (ABC)16 – (4AA)16 [1]
(vii) Study the given propositions and the statements marked Assertion and [1]
Reason that follows it. Choose the correct option on the basis of your
Analysis.
X – Moumita is a topper
Y – Moumita is in the merit list.
Assertion: If Moumita is in the merit list, then she is a topper (Y=>X).
Reason: Inverse is formed when both antecedent and consequent are negated.
a) Both Assertion and Reason are true and Reason is the correct explanation for
Assertion.
b) Both Assertion and Reason are true and Reason is not the correct explanation
for Assertion.
c) Assertion is true and Reason is false.
d) Both Assertion and Reason are false.
(viii) Binary code of (743)8 is : [1]
a) 111100011
b) 100111011
c) 101110111
d) 111001111
(ix) 1’s complement of (5)10 in terms of 4 bits, ignoring the sign bit. [1]
a) (7)10
b) (10)10
c) (5)10
d) (4)10
(x) 2’s complement of (1101)2 is: [1]
a) 0110
b) 0010
c) 0011
d) 1110
Question 2
(i) The following statement will generate a compile time error. This can be rectified
in 2 different ways, without losing precision of price. Write these statements. [2]
float price = 17.99;
Page 2 of 9
(ii) The java statement to print the position of 2nd occurrence of the letter 'I' within
the word "MICHIGAN". [2]
(iii) The following function getPart() is a part of some class which is used to extract
h number of characters starting from index b of a string str. There are some
places in the code marked by ?1? , ?2? , ?3? which must be replaced by an
expression/statement so that the function works correctly.
(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]
(iv) Ram and Hari are coder friends, who are debating effective usage of memory
while using variables, without compromising on precision of values. Help them on
identifying the right data type to use, for the following data: [3]
(a) Population of a country
(b) Interest rate in a bank account
(c) Compounded time
Page 3 of 9
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) From the logic diagram given below:
a. Derive the Boolean expression for X(A,B,C) and [4]
draw the truth table.
b. Write the dual of the SUM and CARRY of a half adder. [1]
(ii) Draw truth table and the logic circuit diagram of A’.B+(A.C’+A’B’C)
using NAND gate only. [5]
Question 4
(i) Post pandemic, to encourage the tourism industry in India, the Ministry [5]
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.
• The tourist is the government employee and has repeated the resort visit in
a span of six months.
• The tourist has an AADHAR card and has repeated the resort visit in a
span of six months.
Inputs:
A: The tourist has an AADHAR CARD
C: The tourist has a criminal record
G: The tourist is the government employee
V: The tourist has repeated the resort visit in a span of six months
Output: F: The tourist would be allowed to book the resort at rebate.
Draw the truth table for the inputs and outputs. Also, write Boolean expression
with disjunction operators for each of the true values (0’s) from the output column
of the truth table. Also write a propositional expression by joining the terms with
conjunctive operator.
Page 4 of 9
(ii) Draw the logic circuit diagram for the simplified form of the following
expression: AB’C’+ AB’C + ABC The circuit diagram should only contain one
AND, one OR and one NOT gates. [3]
(iii) Perform binary subtraction using 2’s complement (10011)2 – (11100)2 [2]
Question 5
(i) Write the Boolean expression and logic gate diagram of XOR gate using NOR
gate. [5]
(ii) From the logic gate diagram given below, derive the Boolean expression for
X(A,B,C) and reduce it using Boolean laws. [3]
(iii) Verify if the following compound proposition is valid or not using the
truth table. [2]
(A ^ B) ^ C => (A^B^C) (A^B^C)
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 6 [10]
A class MightyNumber has been defined to create m1 and m2 as might numbers from
integers n1 and n2. m1 will become mighty by placing the eventual sum of the digits of n2 at
the end of n1. m2 will become mighty by placing the eventual sum of the digits of n1 at the
end of n2.
Example: If
n1=235, the eventual sum of digits of n1= 1
Page 5 of 9
n2=106, the eventual sum of digits of n2 = 7
then, m1 = 2357 and m2=1061
The details of the members of the class are given below:
Class name : MightyNumber
Data members/instance variables:
n1 : to store the first integer
n2 : to store the second integer
m1 : to store the first mighty number
m2 : to store the second mighty number
Methods/Member functions:
MightyNumber() constructor to initialize data members with
legal initial values
void accept() to accept values for n1 and n2
int sumofdigits(int n) to return the eventual sum of digits of n
void calMighty() to calculate the mighty numbers m1 and m2
by invoking sumofdigits()
void display() to display mighty numbers m1 and m2
Specify the class Mighty giving details of the constructor(), void accept(), int
sumofdigits(int n), void calMighty() and void display(). Define the main() function to
create an object and call the functions accordingly to enable the task
Page 6 of 9
Question 7 [10]
Given an m x n matrix, return all elements of the matrix in spiral order.
Example 1:
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [1,2,3,6,9,8,7,4,5]
Example 2:
Input: matrix = [[1,2,3,4], [5,6,7,8], [9,10,11,12]]
Output: [1,2,3,4,8,12,11,10,9,5,6,7]
Write a program to accept a m x n matrix and display the elements of the array in spiral order.
Question 8 [10]
A class SubStrings has been defined to display all the possible substring with distinct
characters from a word.
Given a string s consisting of only lowercase English letters and an integer k, count the total
number of substrings (not necessarily distinct) of s that contain exactly k distinct characters.
Note:
• A substring is a contiguous sequence of characters within a string.
Page 7 of 9
• Substrings that are identical but occur at different positions should each be counted
separately.
Example:
Input: s = “abc”, k=2
Output: Possible substrings are ab , bc
The details of the members of the class are given below:
Class name : SubStrings
Data members/instance variables:
s : to store the string
Methods/Member functions:
SubStrings() constructor to initialize data member with
legal initial value
void accept() to accept values for s
void SubStr(String str, int k) to display the number of possible substrings
and the substrings by taking the string and
number of combinations as parameter.
Specify the class SubStrings giving details of the constructor(), void accept() and void
SubStr(String str,int k). Define the main() function to create an object and call the
functions accordingly to enable the task
SECTION-C
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)
Question 9 [5]
Design a class pattern with the following method.
void Display(String s) : To display the following pattern based on the input parameter word.
(No need to write main method)
Example Input: STEM
Example Output:
S T E M
S S S 4
Page 8 of 9
S T 4 4
S 4 4 4
Question 10 [5]
Define a class remove to remove duplicates from a word.
void Duplicates(String s): To display the word without duplicate letter. (No need to write
main method)
Example Input: SCHOOL
Example Output: SCHOL
Question 11 [5]
Write a method convert to change a decimal number to binary equivalent. (No need to write
class or main method)
Example Input: 12
Example Output: 1100
Page 9 of 9