Trending ▼   ResFinder  

ISC Class XII Prelims 2022 : Computer Science

5 pages, 17 questions, 0 questions with responses, 0 total responses,    2    0
Koustav Chakraborty
Baba Siddhnath College Of Education, Muthra
BACHELOR OF EDUCATION COMPUTER SCIENCE AND APPLICATIONS
+Fave Message
 Home > rudra199140 >   F Also featured on: isc somzenia

Instantly get Model Answers to questions on this ResPaper. Try now!
NEW ResPaper Exclusive!

Formatting page ...

PRE BOARD EXAMINATION CLASS XII SESSION 2021-22 COMPUTER SCIENCE (Theory paper 2) Maximum marks: 35 Time allowed: One and half hour Candidates are allowed an additional 10 minutes for only reading the paper. They must NOT start writing during this time. ------------------------------------------------------------------------------------------------------------------------------------------------Answer all questions in Section A, Section B and Section C. While answering questions in Sections A and B, working and reasoning may be indicated briefly. The intended marks for each questions or parts of questions are given in the brackets [ ]. All working, including rough work,, should be done on the same sheet as the rest of the answers. ------------------------------------------------------------------------------------------------------------------------------------------------SECTION A 7 MARKS Question 1 Read the following statement and identify the correct option which is relatable to the statement: (i) The concept of interface in Java program satisfies ________ element of OOP concept. a) Polymorphism b) Multiple inheritance c) Method overriding d) All of the above [1] (ii) The definition that satisfies proper binary tree is : a) > 2 child nodes b) < 2 child nodes c) > = 2 child nodes d) < = 2 child nodes [1] (iii) Which of these doesn t requires fresh memory to allocate a new value. a) array b) tree c) recursion d) iterations [1] ------------------------------------------------------------------------------------------------------------------------------------------------0422-II-868A THIS PAPER COMPRISES OF 5 PRINTED PAGES & 1 BLANK PAGE TURN OVER (iv) void Binary( int num) { if(num > 0) { int d = num % 2; Binary(num / 2); } } With reference to the program code given above what will the function Binary( ) return when the value of num = 14? a) 1010 b) 1100 c) 1011 d) 1110 [1] Write a Java statement to check whether the word taken from the user is a palindrome or not. [1] (vi) Differentiate between iteration and recursion. [1] (vii) Write the algorithm to perform deletion of very last element of the queue, Also mention the value of FRONT and REAR after deletion. [1] (v) SECTION B 8 MARKS Question 2 Differentiate between interface and class in reference to OOP. Question 3 Convert the following infix notation to postfix notation: A * (B / C) / E + F [2] [2] Question 4 Answer the following questions on the diagram of the Binary tree given besides: i) ii) State the degree of the nodes B and C and also state the level of these nodes if the root node is 0. [2] Write preorder and postorder traversal of the tree given beside. [2] ------------------------------------------------------------------------------------------------------------------------------------------------0422-II-868A 2 TURN OVER SECTION C 20 MARKS Each program should be written in such a way that it clearly depicts the logic of the problem. This can be achieved by mnemonics names and comments in the program. (Flowchart and Algorithms are not required.) The programs must be written in Java, Question 5 (i) Design a class Toggle which toggles the words by converting all the upper case letters into lower case and all the lower case letters into upper case. Example: if the input is DeDiCaTioN then the output will be dEdIcAtIOn. The details of the members of the class are given below: Class Name : Toggle Data members / instance variables : str : stores a word in a string newstr : stores the toggle word len : to store the length of the word Member methods Toggle( ) void readword( ) void toggle ( ) : : : : default constructor to accept the word converts the upper case alphabets to lower case and all lower case alphabets to upper case and stores it in newstr void display( ) : displays the original word along with the toggled word Specify the class Toggle giving details of the constructor, void readword( ), void toggle( ) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task. [6] OR (ii) Design a class VowelWord to accept a sentence and calculate the frequency of words that begins with a vowel. The words in the input string are separated by single blank space and terminated by full stop. The details of the members of the class are given below: Class Name : VowelWord Data members / instance variables : sen : to store the sentence freq : store frequency of each word begins with vowel. Member methods : VowelWord( ) : Constructor to initialize class member with legal value. void read_st( ) : accept the sentence void freq_vow( ) : count frequency of words begins with vowel void display ( ) : display original string with frequency of each words. Specify the class VowelWord giving details of the constructor, void read_st( ), void freq_vow( ) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task. [6] ------------------------------------------------------------------------------------------------------------------------------------------------0422-II-868A 3 TURN OVER Question 6 (i) Design a class Perfect to check if a given number is a perfect number or not. [A number is said to be perfect if the sum of all the factors equals the original number (except the number itself). Example: 6 = 1+2+3 (excluding 6)] The details of the members of the class are given below: Class Name : Perfect Data members / instance variables : num : store the number Member methods : Perfect ( int nn) : parameterize constructor to initialize num=nn int sum_fact(int i) : return the sum of factors of the number (excluding itself using recursion technique void check( ) : Check whether the number is perfect or not. Display number and appropriate message. Specify the class Perfect giving details of the constructor, int sum_fact( ), void check( ) Define the main( ) function to create an object and call the functions accordingly to enable the task. [6] OR (ii) A class Gcd has been defined to find the Greatest Common Divisor of two integer numbers. Some of the members of the class are given below: Class name : Gcd Data member/instance variable : num1 : integer to store the first number num2 : integer to store the second number Member functions/methods : Gcd( ) : default constructor void accept( ) : to accept the numbers int gcd(int x,int y) : return the GCD of the two number x and y using recursive technique void display( ) : displays the result with an appropriate message Specify the class Gcd, giving details of the Constructor, void accept( ), int gcd(int,int), and void display( ). Define the main() function to create an object and call the functions accordingly to enable the task. [6] Question 7 (i) A super class Godown has been defined to store the details of the stock of a retail store. Define a subclass Update to store the details of the items purchased with the new rate and update the stock. Some of the members of both the classes are given below: Class name Data members/instance variables item qty rate amt : : : : : : Godown to store the name of the item to store the quantity of an item in stock to store the unit price of an item to store the net value of the item in stock ------------------------------------------------------------------------------------------------------------------------------------------------0422-II-868A 4 TURN OVER Member functions/methods Godown( ) : : void display( ) Class name Data members/instance variables: pur_qty pur_rate Member functions / methods Update( ) : : parameterized constructor to assign value to the data members to display the stock details Update : : to store the purchase quantity to store the unit price of the purchased item : void update( ) : parameterized constructor to assign values to the data members of both the classes to update the stock by adding the previous quantity by the purchased quantity and replace the rate of the item if there is a difference in the purchase rate. Also update the current stock value as: (quantity * unit price ) void display( ) : to display the stock details before and after updating Assume that the super class Godown has been defined. Using the concept of inheritance, specify the class Update giving details of the constructor, void update ( ) and void display( ). The super class, main function and algorithm need NOT be written Question 8 A Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out). Define a class Queue with the following details: Class name : Queue Data member/instance variable : dat[ ] : array to hold the integer elements cap : stores the maximum capacity of the queue front : to point the index of the front rear : to point the index of the rear. Member functions/methods : Queue(int max) : constructor to initialize the data member cap = max, front = rear = 0 and create the integer array void add_dat(int v) : to add integers from the rear index if possible else display the message( Queue full ) int pop_dat( ) : to remove and return elements from front, if any, else returns -999 void display() : to display elements of the queue Specify the class Queue giving the details of void add_dat(int) and int pop_dat( ). Assume that the other functions have been defined. The main( ) function and algorithm need NOT be written. [4] ------------------------------------------------------------------------------------------------------------------------------------------------0422-II-868A 5 END

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

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

 

rudra199140 chat