0% found this document useful (0 votes)
69 views5 pages

Sample 3 Oswaal

Computer class 10 sample paer 6

Uploaded by

abhinavverma1704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
69 views5 pages

Sample 3 Oswaal

Computer class 10 sample paer 6

Uploaded by

abhinavverma1704
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
Sample Question Paper-2 COMPUTER APPLICATIONS Class-10 Time Allowed: 2 hours Maximum Marks: 100 Answer to this paper must be written on the paper provided separately You will not be allowed to write during first 15 minutes. This time isto be spent in reading the question paper ‘The time given at the head ofthis paper is the time allowed for writing the anstoers ‘This paper is divided into two sections. Aitempt 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 {J pian AEE " Section-A re (Attempt all questions from this Section.) 1. Choose the correct answers to the questions from the given options. (Do not copy the question, write the correct answers only.) @ Which concept is shown in the above image? ED Anatysis} (@) Inheritance (b) Polymorphism (©) Encapsulation (@) None of these (i) Java supports which of the following? (Unieetting (@) Bytecode () JVM (©) Both (a) and (b) (@) None of these (iii) Each primitive data type belongs to a specific eet {@) block (b) object (©) wrapper class _(@) none (iv) Identify the operator that will get the highest precedence in evaluating the following expression: [Analysis] sp tatr-t oe ©)* w+ @- f (*) Which of the following are valid comments? [Understanding] (@) /* comment */ — (b) //comment (©) Both (a) and (b) (€) None : (vi) What is the final value stored in variable x? DT tAnatysis) double x = Math. ceil (Math.abs(=7.3)); (70 80 60 (a 90 26 | OSWAAL ICSE 5amplv Ne a 0d necks tha string starts witha particular sting OF TON? [Understanding isc (vii) Which of the following meth Pies Gace onsen ( , Pha (b) startswith() (9 startsWith”) (a) ce (viii) Which of the following output is not valid for the if....else code given? ing) if (a<=0) (| if (a= -0) ql system.out.print ("1"); , else ( system.out.print ("2 “) b , system.out-print ("3 ™ (a) 12 (b) 13 (3 (d) 23 a (x) Write the output of the following statement _ QQ [Analysis system.out.printin(Character.ishetter (‘a’) && Character.isUpperCase(°t’)) 7 (a) True (b False (© True (@) FalseT (x) How many times the for loop will execute? [Analysis] for(i = 0;i<5;it+) Q system.out .printin (“hello”); break: ) (@5 4 1 @o (xi) Given a single-dimensional array int xf] = (11, 22, 38, 44}; which of the following will be the value of x{1+2)? BG [Analysis] 0 (b) 22 ©3 (a) 44 (aii) Method prototype for the method Quadratic that accepts an integer and returns nothing is: [Understanding] (a) void Quadratic(void) (b) int Quadratic(int) _(c) void Quadratic(int) __(d) None of these (xiii) The statement that does not make the program control jump to another section of the code is: [Recall] (@) for () break (©) continue (@) exit (xiv) The default value for a string variable in Java is: [Recall] @*" bw’ ww (4) null (xv) The methods to input strings using scanner? [Recall (2) next (6) nextint@ (6) nextLine) (4) Both (a) and () (vi) Assertion (A): The Math class functions can be used without importing the lang package. [Afi] [Application] Reason (R): Math class is in lang package, which is imported by default. (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)- (©) Assertion (A) is true and Reason (R) is false. (d) Assertion (A) is false and Reason (R) is true. (vil) Ridhima wants to decrease the value of the variable p by 10. What will be the correct statement for it? @ p=-10 er _(@) p10; Or (@p- =10 (vii) Given a sting st="Publicaccess; e eaaealanrene The statement used to display the 3rd and 4th characters in uppercase of the string str="Publicaccess” is: (@) system. out.printin(str - Substrin oUppercase(}); ysyetaa string (2,4) .toUpperCase()); out printIn(str.substrin -substring (2,3) .toUpperCase()); ia Syeten-out PrintIn (str. substring (2) -toUpperCase()); yetem-out .print1n (str. substring (2,4) .touppercase () pew — ) Consider the following program segment in which the statements are jumbled. Choose the correct order of the (es for returning the sum of agi ofthe number reeived argument Equ Amara 0,d-0; int sumdig (num) { while (num>0) int su numenum/10; //Statl sum-sumtd; //Stat2 d=numsi0; //stat3 return sum; //Staté ) ) 2-91-4493 (6) 4929143 (91925354 (4) 3929144 Armsetion (A) The formal parameters ofa function éarry ether vakes Gr references ofthe aetual PARR Reason (R): Arrays are passed by reference. (Appaeiea) {a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanati (6) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct expla {@) Assertion (A) is true and Reason (R) is false. {4) Assertion (A) is false and Reason (R) is true. ion of Assertion (A). snation of Assertion (A): 2. (i) Convert the following if else if construct into switch case: [Understanding] [2] if(var == 1) system.out .print1n (“good”) ; 2) System.out .print1n (“better”); else if(var == 3) system.out.print1n(*best”); else if(var else system-out printin (*invalid”); (ii) Evaluate the following expression when values of x, ¥ and z are initialised: (BG Analysis] (2) int x=2, y-4) 2-17 int resul (Gy The following code segment should print “You wil Ii —/ studies(fs). However, the code has errors. Fix the code so that it compiles and runs correctly boolean wh = True; boolean fs= true i (wh and fs) system. output ( else system.output ( (iv) Write the Java expression for: es [eB eC , { agg te or ee output of the code. BD Analysis} 2) nt 43 for( in5 ; 4 >a1 st ‘ (442) toy + (Hh) + (4H E ive happily” if you work harder (wh) and focus entirely on [Analysis] [2] you will live happily “) your life will be a hell”); DD understanding] i£(i¥2==1) continues System.out print ( it” ")7 ) patie i ' (vi) Write the output of the following statements: [Analysis] [2] String s=“abcdef”; String p="AbcDef” 3 Section-B e | ; (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 Java as the base Each program should be written using variable description/mnemonic codes so that the logic of the program is clearly depicted. Flow charts and algorithms are not required. ___Buffered Reader/Data Input Stream should not be used in the programs. 3. Define a class Laptop, according to the specifications given in the following case: ‘An electronics shop has announced a special discount on the purchase of Laptops as given below: [Efi] [Understanding/Application] [15] Category Discount on Laptop Up to 25,000 5.0% 25,001 — 50,000 75% 50,001 ~ 1,00,000 100% More than 1,00,000 150% Data membersfinstance variables: name price dis amt Member Methods: void accept) - to accept the details (name of the customer and the price) void compute()- to compute the discount void display()- to display the name, discount and amount to be paid after discount. Write main method to create an object and call the above methods. 4. Define a class in Java to accept an array of integers and perform bubble sort on the array in descending order. [fi] [Understanding/Application] [15] 5, Define a class in Java to find the second most frequent character in a given string. [Understanding/Application] [15] 6 A double-dimensional array is defined as N[4][4] to store numbers. Define a class to find the sum of all even ‘numbers and product of all odd numbers of the elements stored in Double Dimensional Array (DDA\. [Understanding/A pplication] [15] Sample Input: 12101517 3011 3271 17 142931 41,33 40 51 Sample Output: Sum of all even numbers: Product of all odd numbersi. ..--- 7. Define a class to input a number and check and print whether its a Pronic number or not. [Pronic number is the number which is the product of two consecutive integers.) {i [Understanding/A pplication] [15] Example: 12 =3*4 2 = 4°5 2-67 8. Define a class to overload a function series() as follows: [Understanding/Application] [15] {@) void series (int x, int n) - To display the sum of the series given below: wt 32 +20 +. terms (b) void series (int p) - To display the following series: 0,7, 26, 63. .. p terms (6) void series() - To display the sum of the series given below: eee 1 23 0 aa

You might also like