Formatting page ...
'e BREl's Blue Ridge Public School Seconda ry Section Name: _ _ _ _ _ _ _ __ Std: X Date: 23101/24 Subject: Computer Appllcatlo na Time: 2hra Mu. Marka: 100 Pre-Board 2023-2024 Answer lo th,s paper must be wnl/en on the paper provided separately. The paper is divided Into IWo Sections Al/empt all questions from Section A end any four from Section B. The intended marl<s for questions or parts of questions ere given in bracl<ets { J. SECTION A (40 Martial Att.mpt II questlona. QUESTIO N-1 (20) Choose the correct answers to the questions from the given options. A data type which contains integer as well as fractional part and occupies 32 btts space is: a) float b) char C) double d) byte ii. Choose the odd one out a) (} b) c) d) () iii. A ____ _ is a bug in a program that causes tt to operate Incorrectly but does not terminate abnormally: a) syntax error b) runtime error C) logical error d) no error IV Assert1on(A): A method Ciln have several return statements, but onty one of them will be executed Reason(R) A return statcrncnt is a jump statement that exits control from the method a) Asscrtion(A) Is truo and Reason(R) Is false b) Assertion(A) Is !also and Reason(R) is true c) Both Assertion(A) ond Reason(R) are true and Reason(R) is a correct explanalion of Asscrtion(A) d) Both Assertion(A) and Reason(R) are true and Reason(R) is not a correct explanation of Assertion(A) v. Identify the following oporat0<s: I, , I , ?: a. assignmenl, relational, temary, logical b. relational, logical, assignment, ternary c. logical, assignment, relational, temary d. logical, relational, temary, assignment vi. The output of the below eode segment is: System.ouLprlnUn(Math.pow(Math.coll(Math.aba(-3.4)), Math.floor(3.8))); a. 81.0 b. 64.0 C. 27.0 d. 8.0 vii. Which correct statement is used to convert the following value of y into decimal form? Stringy u24"; a. float z = Float.parseFloat(y); b. Double z = Double.parseDouble(y); c. Float z = Float.valueOf(y); d. double z = String.valueOf(y); viii. The return type of a construdor is: a. void b. class name c. no return type d. None of the above ix. Size of a boolean literal is: a. 2 bytes b. 4 bytes c. 1 bit d. 2 bits P,C>gr mme,a to The - - - - helps Jav develop, run, c.ompde deb ug sou rce prog,ama a JO I( b JV M C JC L d. IDE i. xii. S ei .c t1 11 e- -~. . int II X. lnljlOJ; 10 b. Siring 11 na me , new nam elf J. c. lloe1 I JI new 11oaq10J. d. Double I Jd new dou ble ( 1OJ. era Within the t all ow , acc eH lng da la me mb tha or cif, tpe e11 acc lhe me Na 1co pe ola cla sa: pub~c b. priv ate C. protected d. sec ure xiii. Given the jav a statement: 6. b:4 , c:- ~? c); wh at wil l be the ou lpu t if a= bl && b a> ln( int tpr ou m. ste Sy a. tru e b. 2 C. 14 d. false xiv. co de snippet: State the ou tpu l of the following om pa reT o(" CL OC K" )); Sy sta m. ou tpr lnt ln( "C LO ak ".c a. 30 b. 32 C. -30 d. -32 KV. Th e output for System.outprinlln(Doubla.va . 10001 b. 30003 c. 10000.0 d. 10001.0 0 xOf('.'))); la: luaOf(" 10001 ") ("4 .37 56 ".In de r xv, - - - - - are decla1ed only once fo1 3 class ano all the ob1ects 01 the etas, will share lhese data membe r, Instance vanables b. Class variables C Local varlab iH d Ob,ect variabie. xvu The parameters passed on the method call are called _ _ _ _ parame ters a. actual b. lonnal C. global d local xviii. The minmum number of times the body of the for loop and while loop ii executed ls at teaat _ _ _ _ times. a. zero b. one c. lWO d. none of theoe xix Arrays are passed using the call by _ _ _ _ by defautt. a. value b. reference C. prim~ive d. none of these xx. The _ _ _ _ package supports String handling in Java. a) java.util b) java.io c) java.lang d) Java.awl QUESTION-2 Write the Java expression for the following mathematical expression: zY + Ix - YI Jx-y [2J Give tf1e ou10u1 or the follow,ng eodc when v 1 int 111 (2) 10, S: itc h (v) I c: 1: C&e 2 : caee l: l ; C 4: Sy t -.ou t.pr int.l n("T h Y&.lue o~ _ .. + a); brea k; c o: - -- a +-+1 2+.: -2: syet. ea,01 11t.p rintl 11(" Th valu e o~ ++) ;brea ft; e Ill. iv. a string: Wrife a statement each to perform the following task on string a. Find and display the posttion of the last apace In type. data le doub to x string b Convert a number stored in a (2] ing program? What is the resun of compiling and running the follow cl. &x.a aple (2] pub lic void -tho d(in t k) { Sya t.a.o ut.p rint ln(k ); ) pub lic int -tho d(in t i) ( Sya t.a.o ut.p rint ln(i +l); retu rn i+l; ) pub lic at.t ic void aain (Str ing II arga { Zxaa ple e new Zxa aple (); e.-t hod (5); v. Name the following: a keyw ord a) Th ace ape cifie r that doee not need b) int !JI] - t [2J {{1 ,6,! l},{ 4,6, 2),( 5,3, 8)); l) Give the valu e o~ aat. leng th and -t! l]( [2J vi. Distinguish between -= operator and equals() method. vii. value of x. y and z Evaluate the value of res in the following expression if the (2) are 12, 3, 10 respectively int rea {y< x)?( --x y++ + 10) :x+s ; VIII 121 Gove !he output of lhe followmg p1og1am segment and men1ton how many !Imes !he loop w,11 execute int a o, 1 4 while (1++ < lO) ... 1 2; .. ... out. println (" "+ +" "+" is"+i) ; [2) Gove lhe oull)U1 of the following Java s1a1emen1s Strin9 () ( "LIOM" "TIGER" "&L&PHANT" "LIONESS"); . (0). (1 [3))); Syat-. out.println (a (21. charAt(a [21 . len9th () -21 a(3) .charAt(a(JJ Jen9th() /2)); Identify lhe following java statemenls as an example of unboxing and aU1oboxing: a) Inteter in 687; [2] bl Double d - Double(48.5); double c d; SECTION B (IIO M1rll1) Attempt ony FOUR qu..uona from this HCllon. E,ch program 5hould be wrtnen using v1rl1ble ducrlpdonlillnemonlc codN 111ch 1h111111 /Of/le of rho program la ci..ty depicted. QUESTION .3 Define a class called Matrix with lhe following descriplion: (15) ln1tance variables/Data Membera: int ( J [ J a: To and 3 a two d.iaenaional array with 3 Member Methods: void ;etData () : To accept nuaber1 in th array void rowSua O : To ccaputei and print the of each row of th void colSua(): To computei and print th of the of each column void ahowData () : To the 2-D Array in aatrix fora.at Write a main method 10 c,eale an objecl of the class and call lhe above member methods. uuESTION - 4 (15] ,,,.!i-,gn ,1 class lo ove,toad ;a lunchon joyStringO as foUowa > void JoyStrlng(Strlng 1, char ch 1, char ch2): - to tho argume nt ch1 with the charact ,r ch2 In the given atrlng I and printa the n-1trin g. b) void JoyStrlng(String a) :- to print tho pooltion of the flrol 1p1c ind the 1111 1p1c1 of the given atrlng 1. cl void JoyString(Strlng 11, String ,2)- to combine the two otrtnge with be-n them and prints the ,..ultan t 1trlng (15) QUEST ION-5 e_ech A number Is said to be Happy 11 rt leads 10 1 after a aequence of slept, wherein 1tep. the number Is 1eplaced by the sum of the squares of Its digits. The process " repealed with the resultant number till It becomes a single digit number. II the resultant number equals 1. then the number is said to be a Happy Number. Bxaap l : Con.aid er th nwaber 19 19 > 1 2 82 > 81 ,. > 62 511 2 + 21 - 82 68 100 82 2 2 100 > 1 2 + 0 + 0 So, 19 Sappy n\lllber Write a Java program to input a number and determine n It is Happy. QUEST ION-& [15) Wri1e a Java program to take an input of forty words in an array. Arrange thete words in descending order of the alphabets using the Selection Sort technique. Also, print the sorted array. QUEST ION-7 [15) Below is a sorted array of integers that represents the year of graduation from school: (1982, 1987, 1993, 1~. 1999, 2003, 2006, 2007, 2009, 2010} Wrtte a program' to accept a )'1iar of grad~ation as an integer value from the user. Using the Binary SHrch technique on the above sorted array, search for the Input year. If the input value is located In the array, display "Recor d exists". If not. output the message "Record doea not 11tlat" QUESTION-8 f1SJ Wn1e a program to accept two words of the same length and check whether they are Anagram or not An gram: A word that la m d with the combination of th letters prHent in th orlgln I word, which mHna II the letters of the original word muat be uaed In the aecond word. For example. Wthe first word la FLOW and the aecond word Is WOLF, the two words are Anagrams. WOLF Is formed with the comblnallons of the letters present In the original word FLOW
|