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

CMS FIRSTComparative 2020-2021 (2)

This document outlines the examination paper for Class XII Computer Science for the academic year 2020-21, detailing the structure, instructions, and the distribution of marks across various sections. It includes two parts: Part I, which consists of compulsory questions totaling 20 marks, and Part II, which requires students to answer six questions from three sections totaling 50 marks. The paper covers topics such as Boolean algebra, programming in Java, and algorithm design.

Uploaded by

shrutisaxena1706
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

CMS FIRSTComparative 2020-2021 (2)

This document outlines the examination paper for Class XII Computer Science for the academic year 2020-21, detailing the structure, instructions, and the distribution of marks across various sections. It includes two parts: Part I, which consists of compulsory questions totaling 20 marks, and Part II, which requires students to answer six questions from three sections totaling 50 marks. The paper covers topics such as Boolean algebra, programming in Java, and algorithm design.

Uploaded by

shrutisaxena1706
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

THE FIRST COMPARATIVE EXAMINATION 2020-21

Class XII (ISC)


COMPUTER SCIENCE
Time: Three hours Maximum marks: 70
Instructions:
* Answers to this paper must be written on the answer script provided separately.
* You will not be allowed to write during the first 15 minutes. This time is to be spent in reading the
question paper.
* The time given at the head of the paper is the time allowed for writing the answers.
* All subsections of each question must be answered in the correct order.
* All working including rough work should be done on the same sheet as the rest of the answer.
* Please do not write anything on your question paper except your name and roll number.
* The intended marks for questions or parts of questions are given in brackets [ ].
* Do not copy the questions on your answer scripts. Copy the correct question number.
* Answer all the questions from Part I and six questions from Part II choosing two questions
from Section A, two questions from Section B and two questions from Section C.

PART I [20 marks]


Attempt all questions from this part.
While answering questions in this part, indicate briefly your working and reasoning
wherever required.
Question 1
(a) If Q  P, then write its inverse and contrapositive. [1]
(b) Write the cardinal SOP for F(X, Y, Z) = X.Y.Z + X.Y.Z + X.Y.Z [1]
(c) Give the dual of the Boolean equation: AB + BC + 1 = 1 [1]
(d) Given F = (A.B) + B.C. Find F using DeMorgan’s law. [1]
(e) Name and draw the logic gate represented by the following truth table: [1]
P Q X
0 0 1
0 1 1
1 0 1
1 1 0
Question 2
(a) Find the maxterm when: P = 0, Q = 1, R = 1 and S = 0. Write the minterm
designation (shorthand notation) of A.B.C.D . [2]
(b) Define syllogism and premises. [2]
(c) Each element of an array ARR[15][20] requires ‘W’ bytes of storage. If the address
of ARR[6][8] is 4440 and the base address of ARR[1][1] is 4000, find the width
‘W’ of each cell in the array. Assume that the array is stored Column Major Wise. [2]
(d) What is the significance of keyword new in Java? Mention the areas where it is used. [2]
(e) Give two differences between charAt( ) and indexOf( ) methods of Java. [2]

C–6 This paper consists of six printed pages. Turn over


Question 3
(a) Give the output of the following code. Show the dry run/working. [2]
char ch = ‘A’;
for(int i = 1; i <= 5; i++)
ch++;
ch++;
System.out.println(ch);

(b) The following is a function/method of some class. Give the output of the function demo( ).
Show the dry run/working. [3]
void demo( )
{
String y = “SCROLL”;
int x = 0;
char c[ ] = new char[y.length( )];
for(int j = 0; j < c.length; j++)
c[j] = y.charAt(j);
while(true)
{
if(x < c.length/2)
{
char t = c[x];
c[x] = c[c.length – x – 1];
c[c.length – x – 1] = t;
x++;
System.out.println(c);
}
else break;
}
}

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 [20 marks]
Answer any two questions from this section. All questions carry equal marks.
Question 4
(a) Given F(W, X, Y, Z) = ∑ (0, 2, 4, 5, 6, 7, 8, 10, 13, 15)
(i) Reduce the above function in SOP form using Karnaugh’s map, showing
the various groups i.e. octal, quads and pairs. [4]
(ii) Draw the logic gate diagram of the reduced expression. Assume that
variables and their complements are available as inputs. You may use gates
with more than two inputs. [1]
(b) Given F(A, B, C, D) =  (0, 1, 4, 5, 8, 9, 10, 11, 12, 13, 14)
(i) Reduce the above function in POS form using Karnaugh’s map, showing the
various groups i.e. octal, quads and pairs. [4]
(ii) Draw the logic gate diagram of the reduced expression using NOR gates
only. Assume that variables and their complements are available as inputs.
You may use gates with more than two inputs [1]

C–6 (2)
Question 5
(a) A person is allowed in a reserved coach in a train, if he/she satisfies the following
conditions:
 The person has a valid reservation ticket and a valid ID proof.
OR
 he person does not have a valid reservation ticket, but holds a valid pass issued by
the Railway department and has a valid ID proof.
OR
 he person is disabled and holds a valid Railway pass issued by the Railway
department and has a valid ID proof.
The inputs are:
INPUTS:
R: the person has a valid reservation ticket
P: the person has a valid pass issued by the Railway department
D: the person has a valid ID proof
H: the person is a disabled person
(In all the above cases 1 indicates yes, 0 indicates no.)
OUTPUT: T- Denotes allowed to travel. (1 indicates yes, 0 indicates no in all the cases.)

Draw the truth table for the given inputs and outputs and write the POS expression for
T(R, P, D, H). [5]
(b) Verify using Boolean laws whether ABC = A.B.C + A.B.C + A.B.C + A.B.C
Mention laws at each step. [3]
(c) Using a truth table state whether the following expression is a Tautology, Contradiction,
or a Contingency. (P  Q)  (P ˅ Q) [2]

Question 6
(a) State the difference between a decoder and a multiplexer. Draw the truth table
and logic circuit for a 3 to 8 decoder. [5]
(b) Simplify the expression (A + B) . (B + C.D) using Boolean laws. [3]
(c) Draw the logic circuit diagram for (P + Q) . (P + Q) using NAND gates only. [2]

SECTION B [20 marks]


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 7
A class Composite has been designed to fill a two dimensional array of order [m  n] with
the first (m  n) composite numbers column wise. The maximum value of both m and n is
20. The details of the class are:
Class name : Composite
Data members / instance variables:
arr[ ][ ] : stores the composite numbers column wise
m, n : stores number of rows, number of columns.

C–6 (3) Turn over


Member functions / methods:
Composite(int mm, int nn) : constructor to initialize the size of the matrix
int isComposite(int p) : returns 1 if p is prime, otherwise returns 0
void fill( ) : fills the array with the first [m  n] composite
numbers
void display( ) : displays the array in matrix form.
Specify the class Composite giving details of the constructor and methods. Also define the
main( ) function to create an object of the class and call the methods accordingly. [10]

Question 8
The distance and the coordinates of the midpoint between two points (x1, y1) and (x2, y2) are
given as:

distance d   x1  x 2    y1  y 2 
2 2

coordinate x  ( x1  x 2 ) / 2 and y  ( y1  y 2 ) / 2

A class Point represents a point on a 2D plane. The details of the class are:
Class name : Point
Data member / instance variable:
cord[ ] : stores the x and y coordinates of a point.
Member functions / methods:
Point(double m, double n) : constructor to assign m to x coordinate and n to y
coordinate
void display( ) : displays the coordinates of a point
void distance(Point B) : displays the distance between Point B and the current
Point object
void midpoint(Point A, Point B) : stores the coordinates of the midpoint between Point A
and Point B, in the current Point object.

Specify the class Point giving details of the constructor and methods. Write the main( )
method to create objects of the class and call the methods accordingly. [10]

Question 9
A class Magic enables the user to accept a sentence and print its Magic words. A Magic
word is one which has consecutive letters within itself at any position. For example the
word MYSTERY has consecutive letters ST and hence is a magic word.
Class name : Magic
Data member / instance variable:
str : to store a sentence.
Member functions / methods:
Magic( ) : constructor
void input( ) : accepts a sentence in UPPER case
boolean check(String n) : checks and returns true if the word in n is a Magic
word otherwise returns false
void display( ) : using the method check( ) displays all the Magic words
of the sentence.
Specify the class Magic giving details of the constructor and methods. Define the
main( ) method to create an object of the class and call the functions accordingly. [10]

C–6 (4)
SECTION C [10 marks]
Answer any two questions.
Each program/algorithm should be written in such a way that it clearly depicts the logic of the
problem step wise. This can be achieved by using pseudo codes.
Flowcharts are not required.

Question 10
Write an algorithm to store 10 numbers in a single dimensional array and print the numbers
in sorted (ascending order) form using insertion sort technique. [5]

Question 11
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 ( ` )
up to 5 2.00
above 5 up to 10 3.00
above 10 days 5.00
Design a class Library to perform the task. Details of the class are given below:
Class name : Library
Data members / instance variables:
name : name of the book
author : author of the book
p : price of the book in decimals
d : number of days taken in returning the book
f : stores the fine.
Member functions / methods:
Library(…) : parameterized constructor to assign values to data
members
void fine( ) : calculates the fine for the excess days
void display( ) : displays the book details along with the number of
days, fine and the total amount to be paid
Total amount is calculated as:
(2% of price of book  total no. of days) + fine.
Specify the class Library giving details of void fine( ) and void display( ) only.
Assume that the constructor is already defined. You need not write the main( )
function. [5]

C–6 (5) Turn over


Question 12
Design a class Check to input any sentence consisting of small letters, digits and special
characters and terminated by “.” , “?” or “!”. Print the sum of the ASCII values of all the
small letters present in the sentence.
For example: If input is “ab22c and e34gh are reb453cd6.”
then the output will be: 1733

The details of the class Check are given below:


Class name : Check
Data member / instance variable:
str : string that stores any sentence terminated by “.”, “?” or
“!”.
Member functions / methods:
Check( ) : default constructor
void readstring(String x) : assigns x to str
int sumalp(String x) : receives the word x and returns the sum of the
ASCII values of all the small letters present in the
word x
void display( ) : by invoking the function int sumalp(String), prints
the sum of the ASCII values of all the small letters
present in the sentence.

Specify the class Check and write the methods int sumalp(String) and void display( )
only. You need not write rest of the methods and main( ) function. [5]

C–6 (6)

You might also like