Formatting page ...
RYAN GROUP OF SCHO0LS ACADEMIC YEAR 2024-25 ICSE, FIRST PREBOARD EXAMINATION STD: X SUB: COMPUTER APPLICATIONS RYAN MARKS: 100 DURATION: 2 HRS Answers tothis 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 givenat 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 Aand any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [J. SECTION A [40 MARKS] (Allquestions are compulsory) Q1. Choose thecorrect answers to the questions from the given options. (Do not copy the question, write the correct answers only.) Fatheri Child 1. Name the feature of java depicted in the above picture. a. Encapsulation c. Abstraction b. Inheritance d. Polymorphism 2.Given array int x(]= {11,22, 33,44}; the value of x(-1] is a. 11 c. 33 b. 22 d. Invalid statement [20] ICSE STD: X -2 COMPUTE 3. Static variables belong to the: a.class c. object b. library d. identifiers 4.Jdentify the operator that gets the highest precedence while evaluating the given expressions : atb%c* d-e a. t C., - b.% d. * 5. Name the type of eror in the statement given below: double x;y; a. Logical error b. Syntax error c. Runtime error d. No error 6. What is the final value double x =Math.ceil a. 7.0 stored in variable x ? (Math.abs(-7.3); C. 6.0 b. 8.0 7. To extract a . d. 9.0 character at index 'n' from a string "mystr a. mystr.charAt(n) C. b. mystr.indexAt(n) 8. Which of the the statement will be mystr.charOf(n) d. Both (b) and (c) following is not true with regards to a switch a. check for an equality statement? between the input and the case labels b. support floating point constants c. break is used to exit from the switch block d. case labels are unique 9. Consider the array given below: STD: X ICSE -3 COMPUTER char ch[ ]={'A',E, T, '0',U'}; Write the output of the following statement: System.out.println (ch[0]* 2); a. 65 C. 'A' b. 130 d. 0 10.int f=10, m-9; String e =(m %f= 9)?YES": NO; System.out.print(e); a. YES c. YESNO b. NO d. NOYES 11.Identify the correct array declaration statement: a. int a[10]; c. int arfil]= 10; b. int a[ ]= new int[10]; d. int a[10]= new int[; 12.Which of the following is a correct prototype of a function check which receives a character ch and integer n and returns true and false: a. public int check (char ch, int n); b. public boolean chk (char ch, int n); c. public boolean check (char ch, integer n); d. public boolean check (char ch, int n); 13. Choose the statement which is equivalent to the given: if(a>b) System.out. println("Honest"); else System.out.printin("Sincere"); a. a>b? System.out. println("Honest"):System.out.println(Sincere"); b. System.out.printin (a>b?"Honest":"Sincere"); STD:X STD: X COMPUTER 4 ICSE c. a>b?"Honest": "Sincere"; "Sincere"; d. a>b: "Honest"? following leads to an 14. Identify which ofthe infinite loop. c. for(i-1;i>=1;it+) d. for(i-1;ib-0;i- -) a. for(i=10;i!-0;i- -) b. for(i=3,;i<-30;i+=3) methods has 15. Which of the following String integer argument? (i) length (ii) substring (ii) indexOf (iv) charAt c. (ii) and (iv) d. (iii) and (ii) a. Only (i) b.(i) and (iv) can have multiple 16. Assertion (A)Assertion: A class Reason: Multiple constructors are constructors defined with same set of arguments. correct explanation of A. a. Both A and R are true and R is the correct explanation of A. b. Both Aand R are true but R is not the C. A is true and R is false. d. A is false and R is true. numbers stored as a and b 17. A girl wanted to calculate the sum of two multiplied by 7. Select the appropriate Java expression. a. atb*7 c. (a+b)*7 b. 7*a+b d. a+7*b 18. The method to convert a String to double is: a. String. toDouble) b.Double. Parsedouble() c. Double. parseDouble(String) d. Double. parseDouble( ) 19.I ICSE STD: X -5 COMPUTER 19. In State which access specifier is less restrictive. a. private c. default b. protected d. public 20. Assertion: An array can store elements of different data types values of the same Reason: An array is a user-defined data type with multiple data type but a different memory index. A. a. Both A and R are true and R is the correct explanation of explanation of A. b. Both A and R are true butRis not the correct C. A is true and R is false. d. A is false andR is true. [20] Q2. 1. How many times the given loop is exxecuted? Give the output of the same. for(k=10;k20;k+=4) { System.out. println(k); if(k%3=0) continue, } 2.Give the output of the following program segment: void encode() String s= DICe"; char ch; for(i-0;i<4;itt) ch= s.charAt(i); if(AEIOUaeiou". indexOf(ch) >=0) System.out. print1n("@"); PASSION" println(arr); System.out. isLetter(arr)) if(Character. 0;i<arr.length itt) ; d'}; statement. the statement with the forCheck displayed. While array.character stored ainalphabets outputs. above 'w', 'a', '&[{4', ', correct the write =ifo(r the part extractsa of appropriate Java which program the package in argument. not does as is output aof thatmethod } 6. Write b. a. follows: one calal to usedkeyword following: have an { i;int ar char and error was error an code, compiling the the only display wants to Kamal the statements get to *PASSION" PASS string type. reference data program. . The Any 5. b. li Aa. the Name 4. Math Ab. number. alphabet aor character an is whethera checks Aa. thatmethod Character following: OMPUTER the Name 3. println(ch); System.out. 7. else D:X ICSE -6 STD:X STD:X ICSE -7 Give the output of the following program int x[]={2,45,7,67, 12,3}; COMPUTER segment: int i,t=0; for (i =0,t=5;i<3;itt,t--) System. out. println (x[ i]+x[t]); Evaluate the following if the value of x=7, y=5 xt= x+++x+ty 9. Write the output for the following: String s1 ="Life is Beautifu" System.out.printin ("Earth" +s1.substring(4): System.out.printn(s1.endsWith(""); 10. What is the data type returned by the following library methods? a. isWhitespace() b. compareTolgnoreCase) SECTIONB[60MARKS] Attempt any four questions from this section The answers in this Section should consist of the Programs in either Blue | environment or any program environment with Javaas the base. Each program should be written using Variable descriptions/Mnemonic Codes so that the logicof the program is clearly depicted. Flow-Charts and Algorithms are not required. Q3. Define a class Discount having the following description: variables: Data Members /Members an article to store the price of int cost String name: double de to store the customer's name discount tostore the [15] ICSE STD: X double amt: amount to store the Member functions : void input() COMPUTER -8 to be paid and name of the article the Stores the cost of amount to be paid. Calculates the discount and customer, cost, discount the of name the Displays customer voidcal() void display() and amount to be paid according to the discount the compute to Write a program format: and display the output as per given List Price Up to 5,000 Rate of discount No discount From 75,001 to 10,000 10% on the list price From Z10,001 to 15,000 15% on the list price Above 15,000 20% on the list price Output: Name of the customer given conditions Amount Discount to be paid Write the main method to create an object and call the above methods. Q4. Write a program to input n number of integer elements in an array and sort them in descending order using bubble sort technique. the same Q5. Write a Java program toaccept a two string and convert uppercase. to [15] ER ICSE COMPUTER -9 Display the string in piglatin fom. NPUT: LONDON OUTPUT:ONDONLAY INPUT: SKY OUTPUT:SKYAY PigLatin: A word is said to be piglatin which is obtained byy framing a new the remaining letters word with the first vowel present in the word with present before the first vowel and ended with 'AY'. X4double dimensional array 4 in values input to program Q6. Write a Java diagonal and sum of right diagonal. left of sum the find and elements Q7. [15] check whether it is a duck and number digit 3 a Define a class to accept number or not. positive integer that Note: A Duck number is a (15] contains at least one zero, examples like 102, 150, 100, etc Valid zeros. starting except for those with 012, 001, etc and Invalid examples like Examplel: Input: 2083 Output: Invalid Il it's a4 digit number Example 2: Input: 103 Output: Duck number follows: Q8.Design a class to overload a method display() as void display) : to print the following pattern using nested loop 12121 12121 12121 [15] STD: X ICSE -10 COMPUTER void display(int n, int m) : To print the quotient of the divisor of mand nifm is greater than n otherwise print the sum of twice n and thrice m. double display (double a, double b, double c): To print the value ofz where z=p*q a+b C q=a+b +c
|