Formatting page ...
frothag<alan 10-A Roll no-q PRELIMINARY EXAMINATION 2024 - 2025 Subjoct: COMPUTER APPLICATIONS Dato: January 15, 2025 Std: 10A Maximum Marks: 100 Time allowed Two hours. Answers to this Paper must be wrilten on the papar provided separatBely. You will not be allowed to write during the first 15 minutes. This time is to be spent in reading the question paper. The timo given at the head of this Paper is the time allowed for writing the answers. This Paper is divided into two Sections. Altempt 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{). This queslion paper has 8 questions on 10 pages. SECTIONA douts-AL, noneofthoe, woppo cdosc, SoVf cer o4p (Attompt all questions from this Section) Question1 Choose the correct answers to the questions from the given options. (Do not copy the question, write the correct answers oniy.) )Assertion (A): An argument is a value that is passed to a method when it is called. Reason (R): Variables which are declared in a method prototype to receive values are called actual parameters. (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 (FR) is false. (d) Assertion (A) is false and Reason (R) 0s true. [201 WVhich of the following A single dimensional array has 50 elemnents. is the correct statement to initialize the last element to 100? (a) x(51]=100 (b) x{49]=100 (c) x{48]=100 (d) x{50]=100 int bYear = Integer.parselnt (bornYear); bornYear? What is the data type of the (a) Date (b) Time (c) Double (d) String What is printed by the below Int Num[=(3, 5, 10. 12, 8): statements? System.out.println(Num[2] +"t" +Num[1] +"" +Num[3) +"" + Num[4-2)): (a) 35 10 12 (b) 10 5 12 10 (c) 5 10 12 8 (d) 12 10 8 5 The valueOf() function converts: (a) Primitive type to String (b) String to primitive type (c) Character to String (d) None of these Gelas;A1e Write the output for the following: char ch = . boolean b= Character.isLetter(ch): System.out.println(b): (a) false (b) true (c) (d) O m3][4]? Which is the starting row and column indices of the array (a) 0 and 0 respectively (b) 1 and 1 2 and 3 (d) 3 and 4 of wrapper (vii~ Automatic conversion of primitive data into an object class is called: (a) Autoboxing (b) Explicit conversion (c) Shifting (d) None of the above Consider the following program segment in which statements are jumbled, choose the correct order of staternents to print the sum, product and difference between numbers in the correct order. void calcul() { int a=2, b=3; System.out. println ("Product:" +(a *b): (1) System.out.printin ("Difference:" +(a- b)); System.out.printin ("Sum :" +(a + b)): (2) (3) (a) (1) (2) (3) (b) (2) (1) (3) (c) (3) (1) (2) id (1) (3) (2) depicted in the image below. Name the concept of java Object Number Byte BooleanCharacter Shot intetgetLona FioatDoutle (a) Functions (b) Wrapper class (c) Polymorphism (d) Iterations What will be the output of the following Java program? System.out.println (Math.sqrt ('A' -1);: System.out.println (Math.cbrt (Q'T)): (a) 8.0 2.0 (b) 8.0 3.0 (c) 5.0 2.0 (d) 9.0 3.0 What is the correct syntax to create an object of a class in Java? (a) ClassName obj = new ClassName(): (b) ClassName obj: (c) obj = new (d) ClassName; ClassName obj = ClassName: 4 Consider the following code: int number ] = new int[5): After execution of this statement. which of the following are True ? (a) number[0] is undefined (b) number[5] is undefined (c) number[2] is 0 (d) numnber. length is 5 Given that int A[] = (35, 26, 19, 76, 58); What will be value contained in A[3] ? (a) 35 (b) 26 (c) 19 (d) 76 The program code written in any high-level language to solve a problem is: (a) object code (b) sOurce code (c) machine code (d) byte code r Srvi What will be the output of the following program? class Example public static void main(Stringll args) { String s1 = "Test": String s2= new String("Test");: System.out. println(s1 s= s2): System.out.printin(s1.equals(s2): (a) true true (b) true false (c) false true (d) false false the following? What will be the output of class A { static void display() System.out.printin("A"): class B extends A static void display) System.out.printin("B"): class Main { public static void main(String[] args) A obj = new B(): obj.display): (a) A (b) B (c) Compilation error (d) Runtime error to describe a collection of Java uses the term related classes. (a) library (b) package (c) folder (d) inheritance 6 (k) What will be the output of the following code? String str = "ICSE 2024" System.out.printin(str. substring(2, 6). (a) CSE (b) CSE 2 (C) SE 2 (d) CSE 2024 Java access modifier? Which of the following is not a (a) private (b) protected (c) public (d) static Question 2 (i) the folowing Java code? What will be the outout of public class Output [2] args) public static void main(String { int A= "26", B= "100"; String D=A +B + "200 int x = Integer.parselnt(A); int x = Integer.parselnt(B): int d= x + y: System.out.println("Result1 = "+D); System.out.printin("Result2=" +d); ( ) What does the method isWhiteSpace(char) do? 7 [21 [2] below code snippetr What is the value of z for the () int z. int x= 2, y 4 , [2] Predict the output of the following code: If p= 1. (iv) int a 1, b= 2. c= 3: Switch (p) case 1: a++; case 2: ++b: break case 3: C- - System.out.printin(a +",+ b+" +c): What is encapsulation? (V) (vi) What is the value of m after m -=9%++n + ++ n/2: when int m= 10, n =6. What are the differences (vi) (vii) [2 evaluation of the following expression? between while and do-while loops Give the output for the following code. int a 4] = new int[2,4,6,8). in Java? [2 [2 21 for (i=0: i<=1; it+) { S= a[i] + a[3-i]: System.out.println(s): (vii) Explain the following terms: (a) Constructor [21 (b) IDE (ix) Explain the difference between equais() and strings in Java. = when comparing [21 The SECTION B four questions from this Section) (AnSwer any anSwers in this section sthould consist of programs in either BlueJ envirohment or any proaram environment with java as ne bas Each program should be wnitten using veriable description /mnemonic codes so that the logic of the program is clearly depicted. Flowcharts and algonithms are not required. Lauostion 3 of the string in Vvie a program to input a string and print each word [15] the reverse order. Sample Input: Enter a string: My name is Raman Sample Output yM eman si namaR Question 4 Question 5 Question 6 elements from the user, Write a program to accept the number of print its index if found, If not what element to search in an array and found, display a suitable message. [15] with4 rows and 7 Write a program to create a two-dimensional array of February. Using this columns to store daily temperatures for the month from the user and structure, write a program to input the temperatures [15] find and display the following: The hottest day of the month The coldest day of the month The average temperature of the month new number after Write a program to inputa number and display the the reversing the digits of the original number. The program also displays absolute difference between the original number and the reversed number. Sample Input: 194 Sample Output: 491 Absolute Difference= 297 9 [15] LOuestion 7 is An Abundant number s a number for which the sum of its proper factors [15) greater than the number itself Write a program to input a number and check and print whether it is an Abundant number or nol. Example Consider the number 12 Factors of 12 = 1, 2. 3. 4, 6 Sum of factors = 1 +2+3+4 +6= 16 As 16 > 12 so 12 is an Abundant number. Question 8 Write a program in java to accept the number of rows and columns from the user, input the values for the rows and columns and then display 2D Array in Matrix format. 10 [15]
|