Formatting page ...
M. P. Birla Foundation Higher Secondary School Selection Examination, 2024-2025 Class - X COMPUTER APPLICATIONS TIME: 2 Hrs. This paper is divided into two sections Section A and Section B. FULL MARKS: 100 Attempt all questions from Section A and any four questions from Section B. The intended marks for each question is given in braces 1. SECTION A (Attempt All questions from this Section) Question 1 Choose the correct answer to the questions from the given options. (Do not copy the questions, write the corect answers only) (i) CLASS |20] Method (int x) Method (int x, int y) Method (int x, int y, int z) Name the principle of OOP depicted in the above picture. a. Polymorphism c. Inheritance b. Encapsulation (i) d. Abstraction Rearrange the statements below, so that num calculation and then display the final value. is converted to an integer for System.out.printIn(number): int number = Integer.parselnt(num); String num = "50"; 3 number= number + 5: a. 2, 3, 4, 1 b. 3,4,2, 1 (iii) (iv) (V) c. 2, 1,4, 3 d. 3, 2, 4, 1 Name the access specifier that allows accessing data members within the scope ofa class only a. private C. protected d. default b. public Which of the following is a valid method prototype? a. public int perform (int a;int b) b. public perform (int a, int b) C. public int perform (int a, int b) d. public perform int (int a, int b) Which of the following is the CORRECT statement to invoke the method with the prototype int computation(int x, char ch)? a. int m = computation (*B', 40); b. int m= computation(): c. int m = computation (B,40); d. int m= Computation (40, B'); Page 1 of S (vi) String method with integer as argument and returns a String: a. substring) b. indexOf) (vi) Size of int data type is: c. charAt() d. ends With() a. 8 bits c. 16 bits b. 32 bits d. 64 bits (viii) Which of the following are Wrapper classes? (i) boolean (i) Boolean (i) character (ix) (iv) Character a. (i) and (iv) b. () and (iii) c. (i) and (iv) d. (ii) and (ii) "Commitment". charAt("Commitment".length()% 3): 9,1 a. m c. C b. o (x) d. i Assertion (A): In function overloading a class can have Reason(R) :Multiple methods are defined with same set multiple methods. of arguments and name Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion(A) b a Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of d. (xi) Assertion (A) is true andAssertion(A) (R) is false Assertion (A) is false and Reason Reason (R) are true String method which returms -1 : a. length() c. indexOf() b. charAt() d. equals() (xii) int al ] ={1,2,5,4, 10}: int s= a[2] +a<4]; (xiii) System.out.println(s); a. 6 b. 15 c.7 d. 12 results in a negative number, which of the a.compareTo(b) following is true: a. a comes before b in the dictionary b. b comes before a in the dictionary C. a andb are the same string d. length of string a more than length of string b (xiv) Arange the following in the descending number of bytes occupied: i. int a]0=new int [3][4); ii. int af] = new int [10]; iii. char a[|[] - new char[10][5]: . (ii), (i), (i) b. (ii), (ii), (i) (xv) c. (i), (i), (ii) d. (), (i ), (ii) Methods which have the same name as of the class but with different set of arguments and does not return a value are termed a. Wrapper class C. methods overloaded constructor d. overloaded methods Page 2 of 5 (xvi) The output of thestatennent : "aeiouAEIOU".indexOf(*"BEIHALA".charAL(3) ; is a. 2 c. 6 b. 0 d. 5 (xvii) Choose the statement which is equivalent to the given: if(a>b) System.out. println("Honest"); else System.out.println("Sincere"); a. a>b? System.out. println(Honest'"):System.out.println("Sincere"); b. System.out.printin(a>b? *Honest": *Sincere"); c. a>b? Honest":"Sincere"; d. a>b: "Honest"? "Sincere": (xvi) and Theblue'" two Java statement are used to check for the equality of the strings BLUE" are as follows: "BLUE". equals("blue") "BLUE". equalslgnoreCase(*blue") The output of the above statements is: a. false, true c. true, false b. false, false d. true, true (xix) Assertion(A): An array can store elements of different data types Reason(R): An array is a user-defined data type with multiple values of the same data type but a different memory index. a. Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion(A) b. Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion(A) C Assertion (A) is true and Reason (R) is false d. Assertion (A)is false and Reason (R) are true (xx) Read the following text and choose the correct answer: A function with the same name that of a class name can be used to initialize the instance variables of the object with the value provided through parameter list. Such constructors are known as a. Default constructor b. Non - Parameterised constructor . Parameterised constructor d. Parameterised method Question 2: [2 x 10 =201 a) Ifthe initial value of x= 5, y-2 what will be the value of x&y after the expression below is evaluated: X+= y-- to-X +tty b) Rewrite the following code using do.. while loop . for(x=10;X>= 0;x- -) : System. out. printin(x+2); Page 3 of 5 c) How many times the given loop is executed? Give the output of the same for(k=10:k<=20:k+-4) System.out. println(k): if(k%3==0) continue; d) A Student executes the given program of the value of a. State the type of the void calculate(int a) segment and it results in 1.0, irrespective error, write the correct statement: double pr=Math. pow(a, /4); System. out. printin(pr); e) int x[ ]U={{10,1,12,13}.x[1][1]+x[2][21? {1,2.3,4).(5,6,7,8}}: (i) What is the of 3? (ii) What is the position value of f) The following code given to calculate for the int display(int u, int was method a, int s) to V= V2as + u calculate v as Fill in the blank : int display(int u, int a, int s) g) Create an initialize the following array structure. |DSWAN UCKQUAIL PEACOCK h) Predict the output for(r=1;r<=3;rt+) CUCKO0 DOVE : for(c=1; <r;c++) {System.out. println(r); i) i) Consider the array: int a[]-{12,35,40,22,56,9, 70}; (a) In the above given array, using linear search, how required to check for the existence of the value 56?many iterations are (b) Write the position of 56. What is the result of the expression "FOUNDATION".charAt("BEHALA".length()) ? Page 4 of 5 Section B (Answer any four questions from this Section) The program should be written using Variable description Question 3 Define a class called Library with the Instance Variables/Data Members: lollowing description: |15] int bookNum stores the serial number of the book. String title - stores the title of the book. String author stores the name of the author. double fine stores the late fee. Member methods: 1. void input() To input and store the book serial number, title and author. 2. void compute()-To accept the number of days late, calculate the fine charged at the rate of Rs. 5 per day. 3. void display() To display the details in the following format: Serial Number Title Author Fine Write a main method to create an object of the class and call the above member methods. Question 4 [15] Write a program to input twenty integers in an array. Accept an integer and check whether the integer is present in the array or not, using Binary search technique. Print an appropriate message. Question 5 [15] Design a class to overload a function perform() as follows: a) void perform(char c, String str)- to print the first letter of str ifc is F, to print the last letter of str ifc is L b) void display( int x, int y) - to display the values of x & y after interchanging the values without using third variable. c) void display( int n, String st) to display the String st from the position ntill end of the string Question 6 [15] Question 7 [15] Write a program 1o accept a word and form a symmetric word. Sample Input : India Sample Output : Indiaidnl Sample Input : Java Sample Output : JavavaJ Define a class to accept values into a 3x3 array and check if it is a Losho grid or not. A grid is a Losho grid if the sum of each row and column equals 15. Print appropriate messages. Example: 492 357 816 Page 5 of 5
|