Trending ▼   ResFinder  

ICSE Class X Prelims 2025 : Computer Applications (St. Xavier's Institution (SXI), Ruiya)

6 pages, 36 questions, 0 questions with responses, 0 total responses,    2    0
Anik Dutta
  
+Fave Message
 Home > anikdutta >   F Also featured on: School Page icse

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

Formatting page ...

ST. XAVIER S INSTITUTION, RUIYA 2024 2025 CLASS X REHEARSAL EXAMINATION COMPUTER APPLICATIONS Maximum Marks: 100 Time allowed: Two hours Answers to this Paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent in reading the question paper. The time given at the head of this Paper is the time allowed for writing the answers. This Paper is divided into two Sections. Attempt all questions from Section A and any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [ ]. SECTION A (Attempt all questions from this Section.) Question 1: [20] Choose the correct answers to the questions from the given option. (Do not copy the questions, write the correct options only) i. Name the feature of Java depicted in above picture. (a) Encapsulation (b) Inheritance (c) Polymorphism (d) Data Hiding ii. The size of \n is: (a) 2 bytes (b) 4 bytes (c) 8 bytes (d) 16 bytes iii. The access specifier that gives least accessibility is: (a) package (b) public (c) protected (d) private 1 iv. The method compareTo() returns ________ when two strings are equal and in lowercase. (a) true (b) 0 (c) 1 (d) false v. The output of the function COMPOSITION .substring(3, 6): (a) POSI (b) POS (c) MPO (d) MPOS vi. Identify the operator that gets the highest precedence while evaluating the given expression: a + b%c*d e (a) + (b) % (c) (d) * vii. What is the output of Math.ceil(5.4) + Math.ceil(4.5)? (a) 10.0 (b) 11.0 (c) 12.0 (d) 9.0 viii. What is the method to check whether a character is a letter or digit? (a) isDigit(char) (b) isLetterOrDigit() (c) isLetterOrDigit(char) (d) isLETTERorDIGIT(char) ix. The extension of a Java source code file is: (a) exe (b) obj (c) jvm (d) java x. Assertion (A): Integer class can be used in the program without calling a package. Reason (R): It belongs to the default package java.lang. (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) is true xi. Method which reverses a given number is: (a) Impure method (b) Pure method (c) Constructor (d) Destructor [P.T.O.] 2 xii. If the name of the class is Yellow , what can be the possible name for its constructors? (a) yellow (b) YELLOW (c) Yell (d) Yellow xiii. Assertion (A): Static method can access static and instance variables. Reason (R): Static variable can be accessed only by static method. (a) Assertion and Reason both are correct. (b) Assertion is true and Reason is false (c) Assertion is false and Reason is true (d) Assertion and Reason both are false xiv. A single dimensional array has 50 elements, which of the following is the correct statement to initialize the last element to 100? (a) x[51] = 100; (b) x[48] = 100; (c) x[49] = 100; (d) x[50] = 100; xv. When an object of a wrapper class is converted to its corresponding primitive data type, it is called as ________. (a) Boxing (b) Explicit type conversion (c) Unboxing (d) Implicit type conversion xvi. What is the output of the Java code given below? String color[] = { Blue , Red , Violet }; System.out.println(color[2].length()); (a) 6 (b) 5 (c) 3 (d) 2 xvii. Which of the following mathematical methods returns only an integer? (a) Math.ceil(n) (b) Math.sqrt(n) (c) Math.floor(n) (d) Math.round(n) xviii. A student executes the following code to increase the value of a variable x by 2. He has written the following statement, which is incorrect. x =+ 2; What will be the correct statement? A. x += 2; B. x = 2; C. x = x + 2; (a) Only A (b) Only C (c) All the three (d) Both A and C [P.T.O.] 3 xix. State the type of loop in the given program segment: for(int i = 5; i != 0; i -= 2) System.out.println(i); (a) finite (b) infinite (c) null (d) fixed xx. Consider the following program segment in which the statements are jumbled. Choose the correct order of statements to swap two variables using the third variable. void swap(int a, int b) { a = b; --> (1) b = t; --> (2) int t = 0; --> (3) t = a; --> (4) } (a) (1) (2) (3) (4) (b) (3) (4) (1) (2) (c) (1) (3) (4) (2) (d) (2) (1) (4) (3) Question 2: i. Rewrite the following code using single if statement. [2] if(code == 'g') System.out.println("GREEN"); else if(code == 'G') System.out.println("GREEN") ii. A student executes the following program segment and gets an error. Identify the statement which has an error. Correct the same to get the output as WIN. [2] boolean x = true; switch(x) { case 1: System.out.println("WIN"); break; case 2: System.out.println("LOOSE"); } iii. Give the output of the following program segment. How many times is the loop executed? for(x = 10; x > 20; x++) System.out.println(x); System.out.println(x * 2); iv. Write Java expression for: [2] | + | [2] 2 + 2 v. int P[ ] = {12, 14, 16, 18}; int Q[ ] = {20, 22, 24}; Place all elements of P array and Q array in the array R one after the other. (a) What will be the size of array R[ ]? (b) Write index position of first and last element. [2] vi. Predict the output of the following code snippet: [2] String a = 20 ; String b = 23 ; int p = Integer.parseInt(a); int q = Integer.parseInt(b); System.out.print(a + * + b); vii. The following code to compare two strings is complied, the following syntax error was displayed incompatible types int cannot be converted to boolean. Identify the statement which has the error and write the correct statement. Give the output of the program statement. [2] void calculate() { String a = "KING", b = "KINGDOM"; boolean x = a.compareTo(b); System.out.println(x); } [P.T.O.] 4 viii. Consider the given program and answer the questions given below: [2] class temp { int a; temp() { a = 10; } temp(int z){ a = z; } void print(){ System.out.println(a); } void main(){ temp t = new temp(); temp x = new temp(30); t.print(); x.print(); } } (a) What concept of OOPs is depicted in the above program with two constructors? (b) What is the output of the method main()? ix. Predict the output of the following code snippet: [2] char ch = 'B'; char chr = Character.toLowerCase(ch); int n = (int)chr - 10; System.out.println((char)n + "\t" + chr); x. When there is no explicit initialization, what are the default values set for variables in the following cases? [2] (a) Integer variable (b) String variable Section -B [30 Marks] (Attempt any four questions from this Section.) _______________________________________________________________________________________ The answers in this Section should consist of the Programs in either Blue J environment or any program environment with Java as the base. Each program should be written using Variable descriptions/Mnemonic Codes so that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not required. _______________________________________________________________________________________ Question 3: [15] Define a class named FruitJuice with the following description: Instance variables/data members: int productCode stores the product code number String flavor stores the flavor of the juice (Example: orange, apple, etc.) String packType stores the type of packaging (Example: tetra pack, PET bottle, etc.) int packSize stores package size (Example: 200 ml, 400 ml, etc.) int productPrice stores the price of the product Member methods: FruitJuice() default constructor to initialize integer data members to 0 and String data members to void input() to input and store the product code, pack type, pack size and product price void discount() to reduce the price by 10 void display() to display the product code, flavor, pack type, pack size and product price Question 4: [15] Write a program to input twenty names in an array. Arrange these names in descending order of alphabets, using the bubble sort technique. [P.T.O.] 5 Question 5: [15] Define a class to accept values into a 3 3 array and check if it is a special array. An array is a special array if the sum of the even elements = sum of the odd elements. Example: A[ ][ ] = {{4, 5, 6}, {5, 3, 2}, {4, 2, 5}}; Sum of even elements = 4 + 6 + 2 + 4 + 2 = 18 Sum of odd elements = 5 + 5 + 3 + 5 = 18 Question 6: [15] Special words are those words which starts and ends with the same letter. Examples: EXISTENCE COMIC WINDOW Palindrome words are those words which read the same from left to right and vice versa. Examples: MALAYALAM MADAM LEVEL ROTATOR CIVIC All palindromes are special words, but all special words are not palindromes. Write a program to accept a word and check and print whether the word is a palindrome or only a special word. Question 7: [15] Design a class to overload a function area() as follows: (i) double area(double a, double b, double c) with three double arguments, returns the area of a scalene triangle using the formula: area = ( )( )( ) + + where s= 2 (ii) double area(int a, int b, int height) with three integer arguments, returns the area of a trapezium using the formula: 1 area = ( + ) 2 (iii) double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a rhombus using the formula: 1 area = ( 1 2) 2 Question 8: [15] Write a method to input any number and print Peterson number or not using method int sum (int n) which will return sum of its digits and will check in main method for the Peterson number. A number is said to be Peterson if the sum of factorials of each digit is equal to the number itself. Example: Number = 145 145 = 1! + 4! + 5! =1 + 4*3*2*1 + 5*4*3*2*1 =1 + 24 + 120 145=145 -----------------------------------------------x---------------------------------------------- 6

Formatting page ...

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

 

anikdutta chat