Trending ▼   ResFinder  

ISC Class XII Analysis Of Pupil Performance 2015 : Computer Science

32 pages, 33 questions, 0 questions with responses, 0 total responses,    0    0
Prateek Gurjar
 Kabul 
+Fave Message
 Home > prateekgurjar >   F Also featured on: School Page

Formatting page ...

COMPUTER SCIENCE STATISTICS AT A GLANCE Total Number of students who took the examination 18,375 Highest Marks Obtained 100 Lowest Marks Obtained 1 Mean Marks Obtained 86.23 Percentage of Candidates according to marks obtained Mark Range Details Number of Candidates Percentage of Candidates Cumulative Number Cumulative Percentage 0-20 16 0.09 16 0.09 21-40 59 0.32 75 0.41 41-60 1156 6.29 1231 6.70 61-80 4352 23.68 5583 30.38 Range of Marks Obtained 69.62 Percentage of Candidates 70.00 60.00 50.00 40.00 23.68 30.00 20.00 10.00 6.29 0.09 0.32 0.00 0-20 21-40 41-60 Marks Obtained 144 61-80 81-100 81-100 12792 69.62 18375 100.00 B. ANALYSIS OF PERFORMANCE PART I Answer all questions. While answering questions in this Part, indicate briefly your working and reasoning, wherever required. Question 1 (a) Simplify: (A + C) (A+ A D) + A C + C [2] (b) Draw a logic circuit for (A + B) (C + D) C [2] (c) Verify the following proposition with the help of a truth table: P (~P Q) = P Q [2] (d) State De Morgan s law and verify it, using a truth table. [2] (e) Answer the questions related to the circuit given below: [2] X Y (i) (ii) Give the output if, X=1 and Y=0 Name the basic gate represented by the above diagram. Comments of Examiners (a) Most of the candidates answered well. Some (b) (c) (d) (e) reduced the expression in one step without showing the working. In a few cases, the laws were used incorrectly. Some candidates were unable to open the brackets in the expression Some candidates interchanged the gates. i.e. OR gate with AND gate and vice versa. This part was well answered by most candidates. Some were confused with symbols and V and interchanged them in the truth table. Some solved algebraically instead of using the truth table. A number of candidates proved both the laws of De Morgan. A few candidates mentioned some other law. Some wrote Break the line and change the sign which is not the law, but a way to remember the law. (i) Most of the candidates attempted this part well except for a few who gave the answer as 0. (ii) A few candidates mentioned the name of the gate used in the circuit instead of the basic gate the circuit represents. i.e NOR gate instead of OR gate. 145 Suggestions for teachers Students should be told to show the working and mention the laws, if necessary in such type of questions. Knowledge of the laws and practice in their application is important. Logic gates and logic circuits must be practiced with almost every expression. Propositional logic should be taught using all terms that are required. The symbols used in propositions must be explained. All the laws of Boolean algebra must be practiced and proved with the help of truth table. Logic circuits with objective type expression must be done. More practice must be given for Universal Gates. [2] MARKING SCHEME Question 1. (a) Simplify: (A + C) (A + AD) + AC + C (A + C) A + AC + C A + AC +AC + C A+C (b) Logic circuit for ( A+B ) . ( C+D) . C (c) Proving of P ~P Q = P Q LHS RHS P Q ~P ~P Q P ~P Q P Q 0 0 1 0 0 0 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 1 1 (d) De Morgan s law states that the complement of sum of the variables is same as product of the individual complements of the variables and vice-versa. (A.B)' = A' + B' (A+B)' = A' . B' (e) A 0 B 0 A.B 0 (A.B) 1 A +B 1 0 1 0 1 1 1 0 0 1 1 1 1 1 0 0 (i) 1 (ii) OR gate 146 Question 2 (a) (b) (c) (d) (e) Define computational complexity. Calculate the complexity using Big O notation for the following code segment: for(int k=0;k<n;k++) s+=k; Convert the following infix notation into postfix form: X + ( Y Z ) +(( W + E) * F ) / J Differentiate between this keyword and super key word. [2] The array D[-2 10][3 8] contains double type elements. If the base address is 4110, find the address of D[4][5], when the array is stored in Column Major Wise. State any two characteristics of a Binary tree. [2] [2] [2] [2] [2] Comments of Examiners (a) This part was answered well by most of the candidates. (b) (c) (d) (e) Several candidates used examples to illustrate the answer. A few candidates found it difficult to provide appropriate definition. Some candidates wrote k instead of n for complexity Most candidates were able to solve this problem correctly. Some candidates wrote the correct answer without showing the working. Some applied the postfix correctly, but could not derive the final answer. Order of precedence was not clear and the placement of + sign was improper in several cases. Examples were used by a number of candidates to show the difference. In some cases, only super keyword was explained. A number of candidates were confused with the width of the cell and assumed different values. Some wrote the answer directly without showing the working or mentioning the formula. Various answers were given by candidates. Some explained with the help of a diagram. Suggestions for teachers More practice must be given in complexity of a code or a segment. All definitions related to complexity must be covered. Examples need to be practiced with conversion of Infix to Postfix notation using direct method or the stack method. The order of precedence must be explained. Java keywords must be explained and practiced in programs for better understanding. Size of various data types must be explained as it is necessary in such type of questions. Formula and working should also be shown. More practice must be given in Binary Tree, its parts and characteristics. MARKING SCHEME Question 2. (a) Computational complexity is the growth rate or measurement of an algorithm. The level in difficulty in solving mathematically posed problems as measured by the time, number of steps or arithmetic operations, or memory space required (called time complexity, computational complexity, and space complexity, respectively). Complexity of the segment = O(n) (b) = X+ ( Y Z ) +( ( W + E) * F ) / J 147 = X + Y Z - + ( W E + * F) / J =X+ YZ-+WE+F* /J =X+YZ-+ WE+F* J/ =XYZ +WE+F*J/+ (c) this ( ) is used to refer to the instance variables of the class. super ( ) is used to invoke the super class s constructor/ instance variable/methods (d) The given values are: B = 4110, W = 8 bytes or 64 bits for double type , I = 4, J = 5, Lr = -2, Lc = 3, M = (10- (-2)+1 = 10+2+1 = 13 Address of A [ I ][ J ] = B + W * [ ( I - Lr ) + M * ( J - Lc ) ] = 4110 + 8 * [(4 - (-2)) + 13 * (5 - 3)] = 4110 + 8 * [6 + 13*2] = 4110 + 8 * [6+26] = 4110 + 8 * [32] = 4110 + 256 OR = 4110 + 64 * [32] = 4110 + 2048 = 4366 (Ans) = 6158 (Ans) (e) 1. It is acyclic 2. No two node can be similar or identical 3. It is recursive 4. There is only one unique path between two nodes. 5. Rooted data structure OR Linear data structure OR Dynamic data structure 6. Every node has a maximum of two sub nodes ( or maximum degree 2 ) Question 3 (a) The following function is a part of some class. Assume x and y are positive integers, greater than 0. Answer the given questions along with dry run / working. void someFun(int x, int y) { if(x>1) { if(x%y==0) { System.out.print(y+ ); someFun(x/y, y); } else someFun(x, y+1); } } 148 (i) What will be returned bysomeFun(24,2)? [2] (ii) What will be returned bysomeFun(84,2)? [2] (iii) (b) State in one line what does the function someFun( )do, apart from recursion? 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 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?, ?4?, ?5?which may be replaced by a statement/expression so that the function works properly. [1] boolean ArmstrongNum( int N ) { int sum= ?1?; int num=N; while( num>0) { int f= num/10; int s = ?2?; int digit = num s; sum+= ?3?; num = ?4?; } if(?5? ) return true; else return false; } [ (i) What is the statement or expression at ?1? [1] (ii) What is the statement or expression at ?2? [1] (iii) What is the statement or expression at ?3? [1] (iv) What is the statement or expression at ?4? [1] (v) What is the statement or expression at ?5? [1] 149 Comments of Examiners (a) Some candidates used examples to illustrate the answer. A number of candidates found it difficult to provide an appropriate definition. A few candidates wrote k instead of n for complexity (b) Most candidates were able to solve this problem correctly. Some candidates wrote the correct answer without showing the working. Some applied the postfix correctly, but could not derive the final answer. The order of precedence was not clear and the placement of + sign was improper in several cases. A few candidates interpreted the expression as sum = = num instead of sum = = N . Suggestions for teachers Students should be asked to show the working and explain with memory blocks. More practice must be given in Recursive techniques. Practice should be given to understand the program line by line and derive at a conclusion of what the function is doing. More practice should be given on programs using conditions / looping and other output related programs. Teachers are expected to show the dry run/ working of program and emphasize that working is necessary to get full credit. More practice must be given in standard programs. MARKING SCHEME Question 3. (a) (i) someFun(24, 2) 24>1 true someFun(24/2, 2) 12>1 true someFun(12/2, 2) 6>1 true someFun(6/2, 2) 3>1 true someFun(3, 3) 3>1 true someFun(3/3, 3) 24%2==0 true output 2 12%2==0 true output 2 6%2==0 true output 2 3%2==0 false call someFun(3, 3) 3%3==0 true 1>1 false output 3 84%2==0 true output 2 42%2==0 true output 2 OUTPUT: 2 2 2 3 (ii)someFun(84, 2) 84>1 true someFun(42/2, 2) 42>1 true someFun(42/2, 2) 21>1 true someFun(21, 3) 21>1 true someFun(7/3, 3) 21%2==0 false call someFun(21, 3) 21%3==0 true output 3 150 7>1 true someFun(7, 4) 7>1 true someFun(7, 5) 7>1 true someFun(7, 6) 7>1 true someFun(7, 7) 7>1 true someFun(7/7, 7) 7%3==0 false call someFun(7, 4) 7%4==0 false call someFun(7, 5) 7%5==0 false call someFun(7, 6) 7%6==0 false call someFun(7, 7) 7%7==0 true 1>1 false output 7 OUTPUT: 2 2 3 7 (iii) Generating Prime factors. (b) (i) 0 (ii) f * 10; (iii) digit*digit*digit; OR (iv) num / 10; OR f; (v) sum = = N OR N= = sum Math.pow(digit,3)) ; PART II Answer seven questions in this part, choosing three questions from Section A, two from Section B and two from Section C. SECTION - A Answer any three questions. Question 4 (a) Given the Boolean function F(A, B, C, D) = (0,1,2,3,5,7,8,9,10,11). (i) (ii) (b) Reduce the above expression by using 4-variable Karnaugh 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. [4] [1] Given the Boolean function: P(A, B, C, D) = ABC'D' + A'BC'D' + A'BC'D + ABC'D + A'BCD + ABCD (i) Reduce the above expression by using 4-variable Karnaugh map, showing the 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. 151 [4] Comments of Examiners (a) (i) Most candidates fared well in this part. Some candidates were not able to draw the K-Map for the POS expression correctly. For a number of candidates the Map rolling concept was not very clear. Grey coding and labelling the K-Map was not clear to a number of candidates. (ii) Some candidates drew the logic circuit using NOR gates while some others drew vague diagrams. (b) (i) Many candidates made errors in place value and putting variables in K-Map. In other cases, the groups were reduced by laws. Several candidates drew the K-Map incorrectly. Some converted the canonical form to cardinal form and then reduced it. Many candidates included the redundant group in the final expression (ii) Some candidates drew the logic circuit using NAND gates while some others drew vague diagrams. 152 Suggestions for teachers Make students reduce POS and SOP expressions using K-Map simultaneously. Students should be told not to include the redundant group in the final expression. Reducing the groups by laws is not needed. Only direct answer for the groups to be written in the reduced expression. More and more practice should be given in drawing logic circuits using basic gates and also with universal gates. Emphasize on arranging the variables in proper order and the importance of cell values corresponding with the variables. Explain clearly how the group are framed and reduced. Redundant groups are not to be included in the final reduced expression. More practice should be given in drawing logic circuits using basic gates and also with universal gates. MARKING SCHEME Question 4. (a) F (A,B,C,D) = (0 , 1 , 2 , 3 , 5 , 7 , 8 , 9 , 10 , 11 ) C+D 0 A+B 1 0 4 A+B A +B 3 0 5 7 0 0 13 1 8 15 1 C +D 2 0 6 1 14 1 9 0 C +D 0 1 12 A +B C+D 11 0 10 0 There is one Octal and one Quad : Octal : ( M0 M1 M2 M3 M8 M9 M10 M11) = B Quad : ( M1 M3 M5 M7) = A + D Hence F (A,B,C,D) = B . (A + D ) 153 1 0 (b) P (A,B,C,D) =ABC D + A BC D + A BC D + ABC D + A BCD + ABCD C D C D CD CD 0 1 3 2 4 5 7 6 A B 1 A B 12 1 13 1 AB 8 1 15 1 9 14 1 11 10 AB There are two quads : Quad1 (m4+ m5+ m12+ m13) = BC Hence P (A, B, C, D) = BC + BD 154 Quad 2 (m5+ m7+ m13+ m15 ) = BD Question 5 A person is allowed to travel in a reserved coach of the train, if he/she satisfies the criteria given below: [10] The person has a valid reservation ticket and a valid ID proof. OR The person does not have a valid reservation ticket, but holds a valid pass issued by the Railway department with a valid ID proof. OR The person is a disabled person and holds a valid pass issued by the Railway department along with a valid ID proof. The inputs are: INPUTS R The person has a valid reservation ticket. P The person holds 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 and 0indicatesno). Output : T Denotes allowed to travel (1 indicates yes and 0 indicates no in all the cases) (a) Draw the truth table for the inputs and outputs given above and write the POS expression for T(R, P, D, H). [5] (b) Reduce T(R, P, D, H) using Karnaugh map. [5] Draw the logic gate diagram for the reduced POS expression for T(R, P, D, H) using only NOR gates. You may use gates with two or more inputs. Assume that the variable and their complements are available as inputs. 155 Comments of Examiners (a) A number of candidates were able to attempt this part satisfactorily. Some candidates did not mention the final expression. Some were confused with the POS expression and took the output with 1 s instead of 0 s. A few candidates took 0 s as outputs but wrote the minterms instead of maxterms. (b) Many candidates fared well in this part. However, some candidates were not able to draw the K-Map for the POS expression correctly. For a number of candidates the map rolling concept was not very clear. Some converted the canonical form to cardinal form and then reduced it. NOR gates in the circuit was ignored by a few candidates. Suggestions for teachers Students should be told to read the question carefully and answer accordingly so that no part is left unanswered. More practice should be given to derive SOP and POS expression from any given truth table (i.e. Minterms and Maxterms ) Make students reduce POS and SOP expressions using K-Map simultaneously. Students should be told not to include the redundant group in the final expression. The circuit diagram for the reduced expression must be practiced both with basic gates and universal gates. MARKING SCHEME Question 5. (a) R P D H 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 POS Expression: T (R ,P, D , H) = (0 , 1 , 2 , 3 , 4 , 5 , 8 , 9 , 12 , 13) 156 T (OUTPUT) 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 (b) D+H 0 R+P 1 0 4 R+P 3 5 12 6 15 1 14 1 11 0 0 1 0 9 0 2 7 13 D +H 0 0 0 8 D +H 0 0 R +P R +P D+H 1 10 1 1 There is one Octal and one Quad : Octal : ( M0 M1 M4 M5 M8 M9 M12 M13) = D Quad : ( M0 M1 M2 M3) = R+P Hence T (R,P,D,H) = D . (R + P) R (R+P) P [(R+P) +D ] D Question 6 (a) Draw the truth table and logic gate diagram for an Octal to Binary encoder. [4] (b) What is a Multiplexer? State an application of a Multiplexer. Also, draw the logic diagram of a 4:1 Multiplexer. [4] (c) Verify the following expression using Boolean laws. Also, mention the law used at each step of simplification. X Y Z + X Y' Z + X Y Z' = X ( Y + Z ) [2] 157 [3] Comments of Examiners (a) Most of the candidates answered this part correctly. A few candidates drew the decimal encoder while some others drew the gates wrong. (b) Some candidates wrote the definition instead of application and in some cases block diagrams were used instead. Some candidates interchanged the gates in the circuit diagram. (c) While most candidates answered this part correctly, some did not mentioned the laws. A few candidates wrote the answer directly in one step. Suggestions for teachers More practice should be given in drawing encoder and decoder. Use of proper connector and gates must be explained. More practice must be given in drawing of multiplexer. Explanation of various gates and their use must be emphasized Tell students that laws must be mentioned while reducing, minimizing or proving an expression. MARKING SCHEME Question 6. (a) Truth table for Octal to Binary Encoder : Input Octal number 0 1 2 3 4 5 6 7 B2 0 0 0 0 1 1 1 1 Output B1 B0 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 Logic Diagram for Octal to Binary Encoder : 0 1 2 3 4 5 6 7 B2 B1 B0 (b) Multiplexer: It is a combinational circuit which inputs parallel data and outputs one serial data. Application: (1) (2) (3) (4) It is used as data selector. Routing of signals Data transmission Telephone exchange ,Tv etc. 158 (c) X.Y.Z + X.Y .Z + X.Y.Z = X .( Y + Z ) = X.Y.Z + X.Y .Z + X.Y.Z = X.Y.(Z + Z ) + X.Y .Z Complimentary law: Z+Z =1 = X.Y + X.Y .Z = X.(Y + Y .Z ) Distributive law: A + B.C = (A+B).(A+C) = X.[ (Y + Y ) .( Y+Z ) ] Complimentary law: Y+Y =1 = X.( Y+Z ) Question 7 (a) Derive a Boolean expression for the logic circuit given below and reduce the derived expression, using Boolean laws: A o B o C o [3] o X (b) What are universal gates? Construct a logic circuit using NAND gates only for the expression: A (B + C) [3] (c) Define Half Adders. Draw the circuit diagram and the truth table for a Half Adder. [4] 159 Comments of Examiners (a) Most of the candidates answered this part correctly. Some candidates gave incomplete answers. A few candidates could not reduce the expression. Some wrote the answer directly without mentioning the intermediate points. (b) Some candidates used basic gates in drawing the logic circuit instead of NAND gates. The concept of Universal gates not clear to a number of candidates. (c) Some candidates drew wrong circuit diagrams. The circuits for partial sum and carry were done separately and not as one circuit in some cases. Suggestions for teachers More practice should be given in deriving expression for any circuit diagram and then reducing it. Drawing of logic circuits using universal gates must be explained clearly. Proving of universality of gates must be explained. More practice should be given in drawing half adder and full adder and also the truth table and expression of both adders. Students must be told that Half Adder is one circuit and not two different circuits. MARKING SCHEME Question 7. (a) 1. 2. 3. 4. (A .B .C ) (A .B .C ) (A .B .C ) . C (A .B .C ) . C + ( A .B .C ) (A+B+C) . C + (A+B+C) (A+B+C) . (C+1) A+B+C (b) Universal gates are derived gates which can perform the function of all basic gates. NAND gate and NOR gate are Universal gates. (c) Half adders are combinational circuits which adds two input binary bits and output two binary bits. (Partial Sum and Carry). 160 Truth table of half adder : A 0 0 1 1 B 0 1 0 1 Partial Sum 0 1 1 0 Carry 0 0 0 1 OR 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 8 A class Admission contains the admission numbers of 100 students. Some of the data [10] members / member functions are given below: : Admission : integer array to store admission numbers Admission( ) : constructor to initialize the array elements void fillArray( ) : to accept the elements of the array in ascending order int binSearch(int l, int u, int v) : to search for a particular admission number (v) using binary search and recursive technique and returns 1 if found otherwise returns -1 Class name Data member/instance variable: Adno[ ] Member functions/methods: Specify the class Admission giving details of the constructor, void fillArray( ) and int binSearch(int, int, int) . Define the main( ) function to create an object and call the functions accordingly to enable the task. 161 Comments of Examiners Most of the candidates were able to attempt this part correctly. Common errors made by candidates in this question were: the concept of recursion was not clear to some candidates; several candidates did not use the parameters in the function; some took extra variables while others did not initialize the array in the constructor; a few candidates wrote the function binsearch( ) without using the recursive technique. The other function including the constructor was well answered. Some candidates did not write the main( ) function and also ignored the comments to be given in the program. Suggestions for teachers More practice should be given in solving programs using recursive techniques. Much attention should be paid by the teachers towards recursion and its techniques with examples. Knowledge of base case and recursive case should be given to the students for every program using recursive technique. Invoking function within another function should be given more practice. The students should create recursive code for most iteration cases. MARKING SCHEME Question 8. import java.util.*; public class Admission { static Scanner x=new Scanner(System.in); int Adno[]=new int[100]; Admission(){ } void fillArray() { System.out.println("Enter 100 elements in ascending order "); for(int i=0;i<100;i++) Adno[i]=x.nextInt(); } int binSearch(int l,int u,int v) { int m=(l+u)/2; if(Adno[m]==v) return 1; OR return m; else if(l>u) return -1; else if(Adno[m]>v) return binSearch(l,m-1,v); else return binSearch(m+1,u,v); } OR u = m-1 else l= m+1 return binSearch (l,u,v); static void main() { Admission obj=new Admission(); 162 obj.fillArray(); System.out.println("Enter value to be searched"); int v=x.nextInt(); int p=obj.binSearch(0,obj.Adno.length-1,v); if(p==-1) System.out.println("No. not found"); else System.out.println("No. is present " ); } } Question 9 A class Merger concatenates two positive integers that are greater than 0 and produces a new merged integer. Example: If the first number is 23 and the second is 764, then the concatenated number will be 23764. Some of the members of the class are given below: : Merger Class name Data members/instance variables: n1 : long integer to store first number n2 : long integer to store second number mergNum : long integer to store the merged number Member functions: Merger() void readNum( ) : : constructor to initialize the data members to accept the values of the data members n1 and n2 voidJoinNum( ) : to concatenate the numbers n1 and n2 and store it in mergNum void show( ) : to display the original numbers and the merged number with appropriate messages Specify the class Merger, giving the details of the constructor, void readNum( ),void JoinNum( )and void show( ). Define the main( ) function to create an object and call the functions accordingly to enable the task. 163 [10] Comments of Examiners A number of candidates were able to attempt this part well. The joinnum() function was not done properly by some candidates. Various methods/techniques were used to concatenate the numbers. Some did it directly without converting it to String type. Several candidates reversed the number using while loop and then added it to the other number. In some cases int was used instead of long data type. Object creation in the main ( ) function was not properly defined in some cases. Constructor and the main() method was answered properly by a few candidates. MARKING SCHEME Suggestions for teachers More practice must be given in conversion from numeric to string and string to numeric. That concatenation of strings is possible but does not work on numeric data, must be explained. Question 9. import java.util.*; public class Merger { long n1,n2,mergNum; Merger( ) { } OR Merger(){ n1= n2 = mergNum = 0;} void readNum() { Scanner x=new Scanner(System.in); System.out.println("Enter two numbers"); n1=x.nextLong(); n2=x.nextLong(); } void JoinNum() { String s=Long.toString(n1); String s1=Long.toString(n2); OR String s2=s+s1; mergNum=Long.valueOf(s2); } void show() { System.out.println("First Number= " + n1); System.out.println("Second Number= " + n2); System.out.println("Merged Number= " + mergNum); } static void main() { Merger obj=new Merger(); obj.readNum(); obj.JoinNum(); obj.show(); } } 164 void JoinNum( ) { int s=1; long a=n2 ; while(a!=0) { s=s*10; a=a/10; } mergeNum = (n1 * s) + n2; } Question 10 A class TheString accepts a string of a maximum of 100 characters with only one blank space between the words. Some of the members of the class are as follows: Class name Data member/instance variable: str len wordcount cons Member functions/methods: TheString( ) : TheString : : : : to store a string integer to store the length of the string integer to store the number of words integer to store the number of consonants [10] default constructor to initialize the data members TheString( String ds) : parameterized constructor to assign str=ds void countFreq() : to count the number of words and the number of consonants and store them in wordcount and cons respectively void Display( ) : to display the original string, along with the number of words and the number of consonants Specify the class TheString giving the details of the constructors, void countFreq() and void Display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task. : Comments of Examiners Different methods / logic was used to extract the words from the sentence. Some candidates used String tokenizer while some others used the split function and charArray to separate words from the sentence. Several candidates did not include the blank space for words. A number of candidates were not able to find the frequency of consonants properly. A few candidates used || operator instead of && operator. The main() function, constructor and object creation were not answered by some of the candidates. 165 Suggestions for teachers Practice should be given to extract characters from words, words from sentences and sentences from paragraphs. Different methods /logic should be adopted so that wider exposure to string manipulation related programs is given to candidates. Knowledge of constructors to initialize a string and other data members should be given. MARKING SCHEME Question 10. public class TheString { String str; int len,wordcount,cons; TheString(){} OR TheString( ) { str= ; wordcount=0; cons=0;} TheString(String ds) { str=ds; len=str.length(); } void countFreq() { char c; str=str.toLowerCase (); for(int i=0;i<len;i++) { c=str.charAt(i); if(c==32) wordcount++; if(c!='a' && c!='e' && c!='i' && c!='o' && c!='u') cons++; } cons = cons wordcount; ++wordcount; } void Display() { System.out.println(" Number of words=" + wordcount ); OR System.out.println(" Number of consonants=" + cons); OR } static void main() { TheString x=new TheString("india is my country"); x.countFreq(); x.Display(); } } 166 ( wordcount + 1 )* ( cons wordcount )* SECTION C Answer any two questions. Each program should be written in such a way that it clearly depicts the logic of the problem stepwise. This can be achieved by using comments in the program and mnemonic names or pseudo codes for algorithms. The programs must be written in Java and the algorithms must be written in general / standard form, wherever required / specified. (Flowcharts are not required.) Question 11 WordPile is an entity which can hold 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 Methods/Member functions: WordPile( int cap) : constructor to initialise the data member 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 the constructor, voidpushChar(char) and char popChar( ). The main function and algorithm need not be written. (b) What is the name of the entity described above and state one of its applications. 167 [8] [2] Comments of Examiners (a) The concept of stack was not clear to most of the candidates. Common errors made by candidates were: (i) the condition / logic for underflow and overflow was not answered correctly; (ii) increment / decrement of top index was not done properly. The methods pushchar() and popchar() were found to be difficult by some candidates. Some were confused with the Character type array and were not able to return properly. The class declaration and constructors was well answered. (b) Some candidates were unable to state the applications and gave vague answers. Some candidates overlooked this part of the question. 168 Suggestions for teachers More practice should be given in data structure programs like the stacks, queues, de queues, etc. Working must be shown as to how the stack or a queue performs (examples can be supportive).The concept of LIFO and FIFO must be explained to the students with examples from real world. Implementation of stacks, queues and de queues using arrays should be emphasized. Only the concept has to be explained taking the base as an array. It should be made clear to students that it is not an array related program which can be manipulated by shifting / inserting or initializing by any value since these data structures requires pointers and pointers are not supported in java. So, the array is used to show the working of a stack, queue or a de queue Stacks and Queues must be explained in details giving all its applications / uses. Students should be asked to read the question carefully and answer accordingly. MARKING SCHEME Question 11. (a) public class WordPile { char ch[] = new char[20]; int capacity,top; WordPile(int cap) { capacity=cap; top=-1; ch=new char[capacity]; } void pushChar(char v) { if(top<capacity-1) ch[++top]=v; else System.out.println("WordPile is full"); } char popChar() { if(top>=0) return ch[top--]; else return '\\'; } } (b) Name of the Entity : Stack Application : LIFO (Last In First Out ) Recursion Undo infix to postfix ( any one) Question 12 A line on a plane can be represented by coordinates of the two-endpointsp1 and p2 as p1(x1, y1) and p2(x2, y2). A super class Plane is defined to represent a line and a sub class Circle to find the length of the radius and the area of circle by using the required data members of super class. Some of the members of both the classes are given below: : Plane Class name Data members/instance variables: x1 : to store the x-coordinate of the first end point y1 : to store the y-coordinate of the first end point 169 [10] Member functions/methods: Plane( intnx, intny ) void Show( ) Class name Data members/instance variables: x2 y2 radius area Member functions / methods Circle( ) : parameterized constructor to assign the data members x1=nx and y1=ny : to display the coordinates : Circle : : : : to store the x-coordinate of the second end point to store the y-coordinate of the second end point double variable to store the radius of the circle double variable to store the area of the circle : parameterized constructor to assign values to data members of both the classes void findRadius( ) : to calculate the length of radius using the formula: ( x2 x1 + y2 y1 )/2 assuming thatx1, x2, y1, y2 are the coordinates of the two ends of the diameter of a circle void findArea( ) : to find the area of circle using formula: r2. The value of pie ( ) is 22/7 or 3.14 void Show( ) : to display both the coordinates along with the length of the radius and area of the of the circle Specify the class Plane giving details of the constructor and void Show( ). Using the concept of inheritance, specify the class Circle giving details of the constructor, void findRadius( ), void findArea( ) and void Show( ). The main function and algorithm need not be written. Comments of Examiners The concept of inheritance was not clear to a number of candidates. Constructor with inheritance was not answered correctly. Accessing the members of the super class by the derived class, Mathematical functions Math.pow( ) and Math.sqrt( ) were not clear to several candidates. In some cases, double data members were not declared properly. Invoking the show() function in the derived class was not answered properly by a few candidates. In some cases, algorithm was written instead of a program. The rest of the function were well answered. 170 Suggestions for teachers Practice should be given to students on inheritance. Use of constructor using the base class member should be made clear. Explain to students the different visibility modes and their accessing capability. Knowledge of calling the member function from the super class to the derived class must be made clear. The keywords extends and super must be given special attention while dealing with inheritance. MARKING SCHEME Question 12. public class Plane { double x1,y1; Plane(double nx, double ny) { x1=nx; y1=ny; } void Show() { System.out.println("x- coordinate= "+ x1); System.out.println("y- coordinate= "+ y1); } } public class Circle extends Plane { double x2, y2, radius, area; Circle(double nx, double ny, double a, double b) { super(nx,ny); x2=a; y2=b; } void findRadius() { radius= ( Math.sqrt( Math.pow((x2-x1),2) + Math.pow((y2-y1),2) ) ) / 2; } void findArea() { area = 3.14 * radius * radius ; } void Show() { super.Show(); System.out.println("Second x- coordinate= "+ x2); System.out.println("Second y- coordinate= "+ y2); System.out.println(" Length of radius = "+radius); System.out.println(" Area = " + area); } } 171 Question 13: (a) (b) A linked list is formed from the objects of the class: [4] class Nodes { int num; Nodes 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 ) (i) Give the meaning of the following common expression in Big O notation: [1] O(N) O(N2) (ii) (c) List any two cases to analyse algorithm complexities. [1] Answer the following questions from the diagram of a Binary Tree given below: B C R F M N H P E (i) Name the leaf nodes of the right sub-tree. [1] (ii) Write post order traversal of the left sub-tree of node B including itself. [1] (iii) State the level number of nodes R and M when the root is at level 0. [1] (iv) Name the internal nodes of the tree. [1] 172 [4] Comments of Examiners (a) This part was well answered by most candidates. A number of candidates did not create a temporary pointer to the first node. Some candidates had problems in moving the pointer to the next node and checking for null. A few were confused whether to count the nodes or to find the sum of the nodes. Some wrote the algorithm in simple English language covering all the main steps. (b) (i) Several candidates were confused and gave vague answers with examples. Some mentioned examples of O(n) and O(n2). (ii) This part was answered well by most of the candidates. Some gave examples to illustrate their answer. A few candidates mentioned the types of complexities instead of cases of complexities. (c) (i) Several candidates mentioned the leaf nodes of the entire tree instead of right sub tree. (ii) While most candidates answered this part correctly some wrote the post order of the entire tree. (iii)This part was well answered by most candidates. (iv) Some candidates included root B also in the answer for internal nodes. However, most of the candidates answered this part well. Suggestions for teachers More programs / algorithms should be practiced with link list and binary tree data structure. Diagrams to illustrate the link list and the Binary Trees must be practiced. Definition of complexities / big O and the three cases of complexities must be explained in detail along with examples. The role of the term (N) in complexities must be explained. All the three cases of complexities with the factors that influence them must be explained to students. Examples in all three cases must also be given. Also explain the difference between types and cases of complexities to students. Explain binary tree with the different parts like root, nodes(internal and external), height, depth ,level, size, tree traversal (preorder, inorder and postorder), etc. MARKING SCHEME Question 13. (a) Algorithm to print the sum of the nodes of odd integers in an existing linked list. Steps : 1 2 3 4 5 6 - Start Set temporary pointer to start node Repeat steps 4 & 5 until the pointer reaches null. Display the Count. Exit. Check for odd integers and accumulate Move pointer to the next node End OR Method to print the sum of the nodes of odd integers in an existing linked list. void NodeCount( Nodes starPtr) 173 { Nodes temp = new Nodes(starPtr) int c=0; while (temp!=null) { if( temp.num%2 !=0) c=c+temp.num; temp=temp.next; } System.out.println(c); } (b) (c) (i) O(n) -- It is the complexity of a single loop or condition / expressions O(n 2) It is a nested loop with each loop going upto n. (ii) Best case complexity and Worst case complexity i. ii. iii. iv. P,E R,N,M,C,B 2 C,M,F,H GENERAL COMMENTS: (a) Topics found difficult by candidates in the Question Paper: The symbols and v from propositional logic Computational complexity definition. Size of double data type for the width of an array cell. Keywords this and super with respect to overriding Extracting digits without using the % sign. K-MAPS (Grouping , map-rolling , place value) Deriving POS expression from a truth table Recursive technique Pre-defined size of an array and re-declaring the size in the constructor. Complexity and Big O Notation Stack operations for adding and removing characters. 174 (b) Concepts in which candidates got confused: The symbols in a proposition. Difference between this and super . Deriving POS expression from Truth table Deriving expression from a given circuit and reducing it. Concatenation of two numbers. Left and right sub tree for a Binary Tree. (c) Suggestions for Candidates: Prepare summary for each chapter or use high-lighters to recognize the important terms and definitions. Always use latest version for compilers and other software. Answers and definitions should be short and precise and according to marks intended. Important words and terms should be underlined or highlighted. Working should be shown at the side of each question where ever required. Laws must be mentioned 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 memorize the program, try to understand the logic. Practice constructors with every program. Treat each function of a class as separate program. 175

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

Additional Info : ISC Class XII Analysis Of Pupil Performance 2015 : Computer Science
Tags : ISC Board, Class 11th, Class 12th, NDA/NA Entrance Examination  

© 2010 - 2025 ResPaper. Terms of ServiceContact Us Advertise with us

 

prateekgurjar chat