Analysis of Pupil Performance: Computer Science
Analysis of Pupil Performance: Computer Science
{{{{}}
Analysis of Pupil
Performance
COMPUTER
SCIENCE
Published by:
Research Development and Consultancy Division (RDCD)
Council for the Indian School Certificate Examinations
Pragati House, 3rd Floor
47-48, Nehru Place
New Delhi-110019
This document of the Analysis of Pupils’ Performance at the ISC Year 12 and ICSE Year 10
Examination is one of its kind. It has grown and evolved over the years to provide feedback to
schools in terms of the strengths and weaknesses of the candidates in handling the examinations.
We commend the work of Mrs. Shilpi Gupta (Deputy Head) and the Research Development and
Consultancy Division (RDCD) of the Council who have painstakingly prepared this analysis. We
are grateful to the examiners who have contributed through their comments on the performance of
the candidates under examination as well as for their suggestions to teachers and students for the
effective transaction of the syllabus.
We hope the schools will find this document useful. We invite comments from schools on its
utility and quality.
Gerry Arathoon
November 2020 Chief Executive & Secretary
i
PREFACE
PREFACE
The CISCE has been involved in the preparation of the ICSE and ISC Analysis of Pupil Performance
documents since the year 1994. Over these years, these documents have facilitated the teaching-
learning process by providing subject/ paper wise feedback to teachers regarding performance of
students at the ICSE and ISC Examinations. With the aim of ensuring wider accessibility to all
stakeholders, from the year 2014, the ICSE and the ISC documents have been made available on the
CISCE website www.cisce.org.
The documents for the ICSE and ISC Examination Year 2020 include a detailed qualitative analysis
of the performance of students in different subjects. The purpose of this analysis is to provide insights
into how candidates have performed in individual questions set in the question paper. This section
is based on inputs provided by examiners from examination centers across the country. It comprises
of question wise feedback on the performance of candidates in the form of Comments of Examiners
on the common errors made by candidates along with Suggestions for Teachers to rectify/ reduce
these errors. The Marking Scheme for each question has also been provided to help teachers
understand the criteria used for marking. Topics in the question paper that were generally found to
be difficult or confusing by candidates, have also been listed down, along with general suggestions
for candidates on how to prepare for the examination/ perform better in the examination.
The Analysis of Pupil Performance document for ICSE for the Examination Year 2020 covers the
following subjects/papers: English (English Language, Literature in English), History and Civics,
Mathematics, Physics, Chemistry, Commercial Studies and Environmental Science.
Subjects covered in the ISC Analysis of Pupil Performance document for the Year 2020 include
English (English Language and Literature in English), Hindi, Physics, Chemistry, Mathematics,
Computer Science, History, Political Science, Economics, Commerce, Accounts, and Environmental
Science.
I would like to acknowledge the contribution of all the ICSE and the ISC examiners who have been
an integral part of this exercise, whose valuable inputs have helped put this document together.
I would also like to thank the RDCD team of Dr. M.K. Gandhi, Dr. Manika Sharma, Mrs. Roshni
George and Ms. Mansi Guleria, who have done a commendable job in preparing this document.
We hope that this document will enable teachers to guide their students more effectively and
comprehensively so that students prepare for the ICSE/ ISC Examinations, with a better
understanding of what is required from them.
Shilpi Gupta
November 2020 Deputy Head - RDCD
ii
CONTENTS
Page No.
FOREWORD i
PREFACE ii
Question 1
(a) State the properties of zero in Boolean algebra. [1]
(b) Find the complement of the following Boolean expression using De Morgan’s law: [1]
F(P,Q,R) = P + (Q′ • R)
(c) Find the dual of: (A′ + 0) • (B′ + 1) = A′ [1]
(d) State whether the following proposition is a tautology, contradiction or a contingency: [1]
F = (P => Q) V (Q => ~P)
(e) Study the diagram given below and answer the questions that follow: [1]
A•
X
B•
1
(c) Majority of the candidates answered this question De Morgan's Law and its
correctly; nonetheless a few candidates made the application should be explained in
following errors: detail.
• The compliments were changed and the 0’s and Teach the principal of duality to
1’s were not interchanged. show that there exists another
equation in every Boolean
• Only the definition was given. equation. Clarify the difference
• Found the dual of LHS and RHS separately between complement and duality
instead of one single equation. with examples.
• Wrote the compliment instead of Dual or wrote Advise students to practice all the
the principle of duality. laws of Boolean algebra and
Propositional logic.
(d) This part was well answered by most of the Emphasise the importance of
candidates. However, a few got confused by the proving of all the laws.
symbols ~, Λ, V and =>. In some cases, candidates Explain the use of the symbols Λ, V,
used the truth table for 3 variables instead of 2 ~, => and <=> in a proposition.
variables. Also a few wrote one column (=>) Give more practice in the concept
incorrectly, and hence got the wrong answer. Some of a tautology,
candidates proved using law instead of the Truth contingency or contradiction.
Table. A few forgot to mention the proposition Teach Truth tables for conditional
being a tautology. (=>) and bi-conditional
(e) This part was answered correctly by most (<=>) thoroughly. Consistent
candidates. Some got confused with the name of practice on Implication and
the basic gate. They wrote NOR gate as given in Equivalence Law is a must.
the diagram and not its representation. Some used Give sufficient practice on how to
the truth table to put the values and state the output. simplify logic diagrams, especially
using universal gates. Illustrate the
working of an AND, OR and a NOT
gate using the universal gates
(NAND and NOR).
Teach Truth tables for all the gates
thoroughly in class.
MARKING SCHEME
Question 1
(a) Properties of zero: A + 0 = A and A • 0 = 0
2
(d) F = (P=>Q) V (Q=> ~P)
P Q ~P P=>Q Q=> ~P (P=>Q) V (Q=> ~P)
0 0 1 1 1 1
0 1 1 1 1 1
1 0 0 0 1 1
1 1 0 1 0 1
(ii) 1
Question 2
(a) State the difference between a Binary Tree structure and a single Linked List. [2]
(b) A matrix B[10][20] is stored in the memory with each element requiring 2 bytes of [2]
storage. If the base address at B[2][1] is 2140, find the address of B[5][4] when the
matrix is stored in Column Major Wise.
(c) Convert the following infix notation to prefix form: [2]
(X + Y) / (Z * W / V)
(d) State the best case and the worst case complexity for bubble sort algorithm. [2]
(e) What is the significance of the keyword ‘new’ in Java? Mention the areas where it is [2]
used.
3
properly in the formula. The base address was not different terms used in address
clear to some of the candidates, they assumed it to calculations.
be b[0][0] by default. Explain diagrammatically the
difference in accessing the elements
(c) Most candidates were able to solve this problem
in Row Major and Column major
correctly. However, some candidates wrote the
arrangement. Give students
correct answer without showing the working.
different types of problems instead
Some applied the prefix concept correctly but,
of direct application of the formula.
could not derive the final answer due to wrong
Different questions with examples
operator precedence. BODMAS was followed in a
need to be practiced with regard to
few cases, but the concept of left-to-right was not
conversion of Infix to prefix and
followed. A few candidates converted the
postfix notation, the order of
expression to postfix notation instead of prefix
precedence and also the Polish
notation.
Stack method. Teach Precedence
(d) This part was answered well by many candidates. rule/ order of operators to students.
However, some only gave examples to illustrate Clarify the difference between
their answers. Some drew graphs to illustrate the Postfix and Prefix to students.
best case and worst case complexities of bubble Explain with examples all the three
sort. A few candidates wrote the definitions of cases of complexities with their
both best case and worst case complexity, however factor that influence it. Explain the
failed to represent both cases in big-O notation. various programs where
complexity differs, example: loops,
(e) Most of the candidates wrote correct definitions /
nested loops, conditional,
examples to this question. Some gave vague
recursion, etc. Teach students the
answers not related to the topic. A few wrote the
best case and worst case for the
syntax of the keyword ‘new’ as significance. They
entire standard algorithm and how
were familiar with the use of the new operator in
to calculate the complexity of any
declaring array or creating an object but were not
given code. Give students code
able to write the significance of the keyword ‘new’
snippets to calculate complexity.
in Java.
Revise class XI syllabus in class
XII. Basic concepts of Java must be
elaborated along with their
programs. Teach the exact use of
the keyword ‘new’. Explain to
students that definitions should be
precise and supported with
examples,if possible.
4
MARKING SCHEME
Question 2
(a) Binary Tree: A data structure in which each node has at most two sub nodes/children (left
& right) Linked list: A linear collection of data elements whose order is not given by their
physical placement in memory. Instead, each element points to the next. It is a data structure
consisting of a collection of nodes which together represent a sequence.
(e) ‘new’ is a dynamic memory allocation operator, which is used to allot memory to non-
primitive data types (example: class, array etc.).
Areas of use: To declare an object, to declare an array.
[5]
Question 3
The following function check( ) is a part of some class. What will the function check( )
return when the value of (i) n=25 and (ii) n=10. Show the dry run/ working.
int check(int n)
{ if(n<=1)
return 1;
if( n%2==0)
return 1 + check(n/2);
else
return 1 + check(n/2 + 1);
}
5
Comments of Examiners Suggestions for Teachers
This question was answered correctly by almost all the Give sufficient practice on
candidates. However, in a few cases, the concept of programs using recursion /
recursion was not clear. Some were unable to accumulate conditions / looping and other
the result along with the recursive calling. In some cases, output related programs. Advise
the intermediate result was returned with each recursive students to show the dry run/
call. Most of the students could do the dry run well but working of program and
made mistakes in returning the right answer as the final emphasize that working is
step. A few candidates showed the working but were necessary.
unable to calculate the final sum. Some wrote the Give more emphasis on Standard
output directly without showing the working / steps and programs especially recursive
ended up losing marks. In some cases, vague workings / programs. Practice should be
outputs were given. given on writing base case,
recursive case, and showing the
working at each step of the
program code. Use Memory
blocks / tables to show the concept
of a stack working for recursive
programs.
MARKING SCHEME
Question 3
(i) check( 25 ) (ii) check( 10 )
1+ check(12+1) 1+ check( 5 )
1+ check(6+1) 1+ check(2+1)
1+ check(3+1) 1+ check(1+1)
1+ check(2) 1+ check(1)
1+ check(1) 1
1
Final output: (i) 1+1+1+1+1+1 = 6 (ii) 1+1+1+1+1 = 5
6
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 4
(a) Given the Boolean function: F(A, B, C, D) = Ʃ (0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13,14).
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the [4]
various groups (i.e. octal, quads and pairs).
(ii) Draw the logic gate diagram for the reduced expression. Assume that the [1]
variables and their complements are available as inputs.
(b) Given the Boolean function: F(A, B, C, D) = π ( 3, 4, 6, 9, 11, 12, 13, 14, 15 ).
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the [4]
various groups (i.e. octal, quads and pairs).
(ii) Draw the logic gate diagram for the reduced expression. Assume that the [1]
variables and their complements are available as inputs.
7
(b) (i) Most candidates answered this question While teaching, highlight the
correctly. Some candidates made errors in arranging of variables in proper
place value and putting of variables in order and the importance of cell
K-Map or drew it incorrectly. In some cases, values corresponding with the
groups were reduced by laws or group variables.
identification was done incorrectly. Some A clear explanation how a group is
candidates included the redundant group in the framed and reduced should be
final expression. Some candidates drew the given to students.
SOP K-Map instead of POS. Clarify the difference between
POS and SOP using examples.
(ii) This part was answered well by most
candidates. However, a few errors were
committed which were the same as given in
subpart (a) (ii).
MARKING SCHEME
Question 4
(a)(i)
8
(ii)
(b) (i)
4 5 7 6
A+B’ 0 1 1 0
12 13 15 14
A’+B’ 0 0 0 0
8 9 11 10
A’+B 1 0 0 1
(ii)
9
Question 5
(a) Draw the logic circuit diagram for an octal to binary encoder and explain its working [5]
when a particular digit is pressed. Also, state the difference between encoders and
decoders.
(b) Draw the circuit of a two input XOR gate with the help of NOR gates. [3]
(c) Convert the following expression to its cardinal SOP form: [2]
F(P,Q,R) = P′Q′R + P′QR + PQ′R′ + PQR′
10
Teach students to fraw the truth
table and to write the SOP and POS
expression from truth table. Train
students to convert Cardinal
expression to Canonical expression
and vice-versa.
MARKING SCHEME
Question 5
(a) Circuit diagram of a octal to binary encoder:
Working: It converts High Level to Low Level. Example: If input is (5) 8 the output will be
(101) 2 , i.e. binary value of 5 and so on. To convert the output signal to 1, a trigger is applied
to the required gate otherwise it remains 0 as default.
An encoder is a combinational circuit which inputs 2n or fewer lines and outputs ‘n’ lines.
It converts HLL to LLL e.g. octal, decimal and hexadecimal to binary
A decoder is a combinational circuit which inputs ‘n’ lines and outputs 2n or fewer lines.
It converts LLL to HLL e.g. binary to octal, decimal and hexadecimal.
(b) XOR gate using only NOR gates: Expression for XOR in POS : F = (A’+B’) • (A+B)
11
Question 6
(a) A company intends to develop a device to show the high-status power load for a [5]
household invertor depending on the criteria given below:
• If Air conditioner and Geyser are on
OR
• If Air conditioner is off, but Geyser and Refrigerator are on
OR
• If Geyser is off, but Air conditioner and Water purifier are on
OR
• When all are on
The inputs are:
INPUTS
A Air conditioner is on
G Geyser is on
R Refrigerator is on
W Water purifier is on
(In all the above cases 1 indicates yes and 0 indicates no.)
Output: X [1 indicates high power, 0 indicates low power for all cases]
Draw the truth table for the inputs and outputs given above and write the SOP
expression for X(A,G,R,W).
(b) Draw the truth table and derive an SOP expression for sum and carry for a full adder. [3]
Also, draw the logic circuit for the carry of a full adder.
(c) Simplify the following expression using Boolean laws: [2]
F = [ (X′ + Y) • (Y′ + Z) ]′ + (X′ + Z)
12
instead of logic circuit. Some candidates were not Clarify the difference between Half
able to derive the expression from the truth table Adder and Full Adder and make
and ended up writing the final simplified them understand how to write the
expression. Sum and Carry were converted to an final expression for the circuit and
SOP expression and the circuits drawn draw the logic gate. Also, instruct
accordingly. students that a Full adder shows the
sum of three bits and a Half adder
(c) Majority of the candidates answered this part
shows the sum of only two bits.
correctly. In some cases, only the final answer was
Reducing / simplifying expressions
given without showing the working/steps or
must be given more practice while
mentioning the laws. A few candidates wasted
ensuring the maximum laws are
time using very lengthy steps for simplifying. In a
covered. Instruct students to
few cases, the laws applied was incorrect while
mention laws along with their
some were not able to reduce the expression
workings. Practice must be given to
completely as they did not have a clear idea of
students on all the laws of Boolean
postulates and laws of Boolean algebra.
algebra and Propositional logic.
MARKING SCHEME
Question 6
(a) A G R W X (OUTPUT)
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
13
(b) Truth Table for a Full adder:
A B C S C0
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
14
SECTION – B
Answer any two questions.
Question 7
Design a class Convert to find the date and the month from a given day number for a [10]
particular year.
Example: If day number is 64 and the year is 2020, then the corresponding date would
be:
March 4, 2020 i.e. (31 + 29 + 4 = 64)
Some of the members of the class are given below:
Classname : Convert
Data members/instance
variables:
n : integer to store the day number
d : integer to store the day of the month
(date)
m integer to store the month
y : integer to store the year
Methods/Member functions:
Convert ( ) : constructor to initialize the data
members with legal initial values
void accept( ) : to accept the day number and the year
void day_to_date( ) : converts the day number to its
corresponding date for a particular year
and stores the date in ‘d’ and the month
in ‘m’
void display( ) : displays the month name, date and year
Specify the class Convert giving details of the constructor( ),void accept( ), void
day_to_date( ) and voiddisplay( ). Define a main( ) function to create an object and call
the functions accordingly to enable the task.
15
the candidates used a longer process to calculate the date regular practice. Teach them the
and have used ‘if-else if’ instead of array. Some did not order in which the function needs
include a leap year check in their program. A few to be called. Advise students to
candidates used a separate local string variable to store the read the question carefully and
month name. The format for display given in the question answer as directed. Explain the
was not used by some, instead they gave the output directly usage of arrays in storing certain
in the display() method. The other methods including the information, which makes the
object creation and method calling in the main( ) was implementation of logic very
answered corectly. Documentation/comments were simple and small.
missing in some cases.
MARKING SCHEME
Question 7
import java.util.*;
class Convert
{ int n,d,m,y;
Convert( )
{
n=0;
y=0;
}
void accept()
{
Scanner x=new Scanner(System.in) ;
System.out.println(("Enter day number and year") ;
n=x.nextInt() ;
y=x.nextInt() ;
}
void day_to_date()
{
int a[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
if(y%4==0)
a[2]=29;
int s=0, c=0;
while(s<n)
s=s+a[c++];
s=s-a[--c];
d=n-s;
m=c;
}
void display()
{ String x[]={"","JANUARY","FEBRUARY","MARCH","APRIL","MAY",
"JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER",
16
"NOVEMBER","DECEMBER"};
System.out.print("\n Day Number: " + n);
System.out.print("\n Date: " );
System.out.print(x[m]+" " +d + "," + y);
}
static void main()
{
Convert obj =new Convert();
obj.accept( ) ;
obj.day_to_date();
obj.display();
}
}
Question 8
Design a class BinSearch to search for a particular value in an array. [10]
Some of the members of the class are given below:
Classname : BinSearch
Data members/instance
variables:
arr[ ] : to store integer elements
n : integer to store the size of the array
Member functions/methods:
BinSearch(int nn ) : parameterized constructor to initialize
n=nn
void fillarray( ) : to enter elements in the array
void sort( ) : sorts the array elements in ascending
order using any standard sorting
technique
int bin_search(int l,int u,int v) : searches for the value ‘v’ using binary
search and recursive technique and
returns its location if found otherwise
returns -1
Define the class BinSearch giving details of the constructor( ), void fillarray( ), void
sort( ) and int bin_search(int,int,int). Define the main( ) function to create an object and
call the functions accordingly to enable the task.
17
Comments of Examiners Suggestions for Teachers
Most of the candidates managed to answer this question Give adequate practice to solve
well. In some cases, additional instance variables were programs using recursive
used which is not in accordance with the question. A few techniques. Attention should be
candidates did not declare memory to the array using the paid by the teachers towards
‘new’ operator. The concept of recursion was not clear to recursion and its techniques with
some candidates. Also, the parameters in the method examples. Give knowledge of
bin_search() was not properly understood by a few. Some base case and recursive case to
candidates were unable to apply the sorting technique the students for every program
correctly. Recursive case was improper, and the return using recursive technique.
statement was missing in some answers. Some Explain the difference between
candidates attempted the recursive method without using iteration and recursion.
the recursive technique and used iteration (loops) instead. Give knowledge of instance
A few had problems in sort() method and used vague variables and their accessibility
techniques for sorting. The other methods including the in the class.
constructor were well answered by many. In some cases, Advise students to read the
object creation and method calling was not done properly question and answer accordingly
in the main() function. A few did not write the main() what is required and not to apply
method. Documentation/comments were missing in their own logic which will change
some cases. the question requirement.
Calling the methods is another
area of concern, ensure that
students not only define methods
but also learn how to call these
methods.
MARKING SCHEME
Question 8
import java.util.*;
class BinSearch
{
int arr[];
int n;
static Scanner x=new Scanner(System.in);
BinSearch(int nn)
{
n=nn;
}
void fillarray()
{ arr=new int[n];
System.out.println("Enter "+n + " elements");
for(int i =0;i<n;i++)
arr[i]=x.nextInt();
}
18
void sort()
{
int t;
for(int i=0;i<n-1;i++)
for(int j =0;j<n-1-i;j++)
{ if (arr[j]>arr[j+1])
{ t=arr[j];
arr[j]=arr[j+1];
arr[j+1]=t;
}
}
}
int bin_search(int l,int u, int v )
{
int m=(l+u)/2;
if(arr[m]==v)
return m;
else if(l>u)
return -1;
else if (arr[m]>v)
return bin_search(l,m-1,v);
else
return bin_search(m+1,u,v);
}
static void main()
{
BinSearch obj = new BinSearch(5);
obj.fillarray();
obj.sort();
System.out.println(" location: " + obj.bin_search(0,4,20) );
}
}
Question 9
A class Mix has been defined to mix two words, character by character, in the following [10]
manner:
The first character of the first word is followed by the first character of the second word
and so on. If the words are of different length, the remaining characters of the longer word
are put at the end.
Example: If the First word is “JUMP” and the second word is “STROLL”, then the required
word will be “JSUTMRPOLL”
19
Some of the members of the class are given below:
Classname : Mix
Data member/instance variable:
wrd : to store a word
len : to store the length of the word
Member functions/methods:
Mix( ) : default constructor to initialize the data
members with legal initial values
void feedword( ) : to accept the word in UPPER case
void mix_word( Mix P, Mix Q : mixes the words of objects P and Q as
) stated above and stores the resultant
word in the current object
void display( ) : displays the word
Specify the class Mix giving the details of the constructor( ), void feedword( ), void
mix_word( Mix, Mix ) and void display( ). Define the main( ) function to create objects
and call the functions accordingly to enable the task.
21
SECTION – C
Answer any two questions.
Question 10
A Circular queue is a linear data structure which works on the principle of FIFO, enables the
user to enter data from the rear end and remove data from the front end with the rear end
connected to the front end to form a circular pattern. Define a class CirQueue with the following
details:
Class name : CirQueue
Data member/instance variable:
cq[ ] : array to store the integers
cap : stores the maximum capacity of the array
front : to point the index of the front end
rear : to point the index of the rear end
Member functions/methods:
CirQueue (int max) : constructor to initialize the data member
cap=max, front=0 and rear=0
void push(int n) : to add integer in the queue from the rear
end if possible, otherwise display the
message “QUEUE IS FULL”
int pop( ) : removes and returns the integer from the
front end of the queue if any, else returns -
9999
void show( ) : displays the queue elements
(a) Specify the class CirQueue giving details of the functions void push(int) and int pop( ). [4]
Assume that the other functions have been defined.
The main function and algorithm need NOT be written.
(b) How is a linear queue structure different from a circular queue structure? [1]
22
properly. Some candidates found the methods queues, circular queues, and de
push() and pop()to be difficult. A few left the queues using arrays.
program incomplete. In some cases, all the methods Instruct students to show the
were attempted which was not as asked for. workings how the stack or queue
(b) This part was answered well by most of the performs. (examples can be
candidates. The difference between linear and supportive).
circular queue was not clear to some candidates and Explain the concept of LIFO and
hence gave vague answers. Some candidates FIFO to the students with
illustrated their answers in diagrams. In some cases, examples related to real world.
the principles of LIFO and FIFO were mentioned as Students should be made to
differences. understand that it is not an array
related program which can be
manipulated by shifting /
inserting or initializing by any
value since these data structures
require pointers and pointers are
not supported in java. Hence, the
array is used to show the
working of a stack, queue,
circular queue or a de-queue.
Teach students about front and
rear pointer index in a queue and
top index in a stack with different
values. They must understand
the difference when the pointer
for front = rear = 0 and front =
rear = -1 for queues or top with
0 and top with -1 for stacks.
Explain Stacks and Queues
(linear, circular and de queue) in
detail giving all its applications /
uses / differences. Give real
world examples to explain the
working of these entities.
Explain the purpose of %
operator in a circular queue to
students.
23
MARKING SCHEME
Question 10
(a) class CirQueue
{
void push(int v)
{ if( (rear+1)% cap !=front)
{ rear = (rear + 1)% cap ;
cq[rear] =v;
}
else
System.out.println(" QUEUE IS FULL");
}
int pop()
{ if (front != rear)
{ front = ( front + 1)% cap ;
return cq[front];
}
else
return -9999;
}
}
(b) In linear queue structure the front index is always less or equal to rear index, whereas in
Circular queue the front index may be greater than rear index.
Question 11
An interface Data is defined with a data member and a method volume( ) which returns the [5]
volume of the implementing shape. A super class Base has been defined to contain the radius
of a geometrical shape. Define a sub class CalVol which uses the properties of the interface
Data and the class Base and calculates the volume of a cylinder.
The details of the members of the interface and both the classes are given below:
Interface name : Data
Data member:
24
double pi : initialize pi = 3.142
Member functions/methods:
double volume( ) :
Class name: Base
Data member/instance variable:
rad : to store the radius in decimal
Member functions/methods:
Base(…) : parameterized constructor to initialize
the data member
void show( ) : displays the radius with an appropriate
message
Class name: CalVol
Data member/instance variable:
ht : to store the height in decimal
Member functions/methods:
CalVol(…) : parameterized constructor to initialize
the data members of both the classes
double volume( ) : calculates the volume of a sphere by
using the formula ( pi x radius2 x height )
void show( ) : displays the data members of both the
classes and the volume of the sphere with
appropriate message
Assume that the interface Data and the super class Base has been defined. Using the
concept of inheritance, specify the class CalVol giving the details of the constructor(…),
double volume( ) and void show( ).
The interface, super class, main function, and algorithm need NOT be written.
MARKING SCHEME
Question 11
class CalVol extends Base implements Data
{ double ht;
CalVol(double r, double h)
{ super(r);
ht=h;
}
public double volume()
{ double x=pi * rad *rad * ht;
return x;
}
void show()
{ super.show();
System.out.println("Height= " + ht);
System.out.println("Volume= " + volume());
}
}
Question 12
(a) A linked list is formed from the objects of the class Node. The class structure of the [2]
Node is given below:
class Node
{
int n;
Node next;
}
Write an Algorithm OR a Method to find the product of the integer numbers from an
existing linked list.
26
The method declaration is as follows:
void Product_Node( Node str )
(b) Answer the following questions from the diagram of a Binary Tree given below:
A
F C
G H B
I D E J
(i) Write the post-order traversal of the left subtree of the above structure. [1]
(ii) State the degree of the Nodes E and H. [1]
(iii) Mention the external nodes of the right subtree. [1]
27
external nodes of the entire tree instead of the
right sub tree.
MARKING SCHEME
Question 12
(a) ALGORITHM:
Step 1. Start
Step 2. Set temporary pointer to the first node
Step 3. Repeat steps 4 and 5 until the pointer reaches null. Display product, exit
Step 4. Accumulate the product by accessing each node
Step 5. Move pointer to the next node
Step 6. End algorithm
METHOD:
void Product_Node (Node str)
{
int s=1;
while (str!=null)
{ s=s*str.n;
str=str.next;
}
System.out.println(“Product=”+s);
}
(iii) E and J
NOTE: For questions having more than one correct answer/solution, alternate correct
answers / solutions, apart from those given in the marking scheme, have also been accepted.
28
GENERAL COMMENTS
29
• Apart from Textbook learning, surfing the net (Wikipedia, School net, etc.) and
other reliable resources would be helpful to gather knowledge on the latest
concepts and enhancements in programming. Proper definitions, output
programs, algorithms, etc. can be downloaded directly from the internet.
• Prepare a summary for each chapter or use high lighters to highlight the
Suggestions for important terms and definitions.
Students • Revise of the entire syllabus thoroughly.
• Relate everything taught in class with Real Life Environment examples which
helps in remembering / recall of the concepts learnt.
• Practical work on the computer is necessary on regular basis to understand the
syntax and to correct errors.
• Answers and definitions should be short and precise and according to the marks
allocated.
• Solve ISC previous years’ question papers.
• Underline/ Highlight Important words and terms.
• Show working at the side of each question, wherever required.
• Mention laws while reducing a Boolean Expression. Practice one form of
K-Map with proper place value for both SOP and POS.
• In programming documentation is compulsory and should be mentioned with
each program.
• Declare the class with data members and member functions.
• Expand or define each function according to the instructions given by the side
of each function.
• Do not memorise the program, try to understand the logic.
• Practice constructors with every program. Treat each function of a class as a
separate program.
• Do your preparations section-wise following the scope of the syllabus.
30