0% found this document useful (0 votes)
20 views28 pages

Sample Paper

COMPUTER SAMPLE PAPER

Uploaded by

goutamarora361
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)
20 views28 pages

Sample Paper

COMPUTER SAMPLE PAPER

Uploaded by

goutamarora361
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/ 28
AMSWEFS £0 this Paper yp ll You will not be gr ot be alt This time is 10 pena MT daring the fi The time given at the head of yao Meadlng the auc Page ge ne on pape me allowed for writing the answers. This Pa 8 __ This Peper is divide Adempt a Sesion from eng 89 to Boa The intended marks for queion end any four art of questo "Wo hours © Written yy am 1 On the pa 'r provided separately, questions from section B. ns are given in brackets [). SECTION-A (Ateempr at qua (4D Marks) ons from this Section.) jon We cont answers 10 the question fom the given option: 8. 2p ne questions, Wit the cortect angers guy) reais WHETE ONE CASS acquires the proper (201 6 Properties of another class: (a) Polymorphism (b) Inheritance oy entify the type of operator &&: (¢) Encapsulation (d) Abstraction en (0) unary (©) logical (4) relational ja The Scanner class methiod used to accent words with space tw next (0) nextLinet) (c) Nextt) (a) nextStringt) in The keyword used to call package inthe program: fe) extends (b) export (o import poor iy Mat value will Math.sqrt (Math.cell (15.3) return? (2) 16.0 (b) 16 (40 (50 «g The absence of which statement leads to fal/through situation in switch case statement? (2) Continue (b) Break (c) Return (d) System.exit(0) ‘Stale the type of loop in the given program segment: forint system.aut.printini te} inite (b) infinite (c) nul () fixed it Wite a method prototype name check) which takes an integer argument and returns @ char: (al char check () (b) vold check (int ») (c) check (int x) (4) char check (int x) 1) The rumber of values that a method can return is: fad (b) 2 (3 (4 ot String P = "20',Q ='22" |W Predict the outout of the following code snippet: String P = "20', Q ="2: int = integer.parseint(P); int = integer value Of(Q); Sistem out printin(a+* "+D); (Q3A108) £202 Nad Vd NOLLYNINVX3 3891 (20 (b) 20 22 (2220 (o)22 8 The Sti i strings is: ne string cl thod to join two strings th t coisa oo toMy estring> joint string) (©) concatfchar (a) Concatt) @ scanned with OKEN Scanner nave (x) uOSeay} pUue (¥Y) UOILOSSY ude palqo Kay SHEYS BU + (Y) Uoseay , fe uoiy uo ypalqo juaLing Up 0, 20UaJa}=4 e SI POH Poin a ee ane OUE|SUI aT ayy 0} SiAj—I BATU} PAOAVAy NPIS BULL (y) worHassy, d 122}010 (2) ayeaud (a) ua s@yioeds 958998 ON (P) payayoud (2) issagoe sea] saniS yeu) 4al)|9ads ss2022 34) [ (9) pue (2) ea ‘apo |LOSW S40} Buys auy ul uayaeey9 jeyads ayy BUeUI HED ‘ase0iamo) 0] Siaypeleya aseiaddn ayy aduey? OUND ‘BseH9MO} 0} BUINS OY} UI JayDeIeY? YEAS SAMO) {UL BUN|S e 0) poUjaU (jasequamo joy 3a} 921249 a5" ni) 6 (9) ot ‘f¢) qu weu=[U0 iAeuie aly jo saquinu xaput yse} au) $14 | “anay S1 (4) UOSeay pUe asye| SI [\/) YONASSY 2518) S| (4) Uoseayy pue anuy s| (iy) YOO “cy vos fo uoneueyda spauco ei (a) uozeoypue av ae uosesy pue (y) woruassy WHE (iy) wonuassy Jo uoneUerdxa yauOd & } YOSeey pue ann are (4) uoseay pue (iy) uolHassy WIOd « 7950 BU 0} syiejap jenuasse 3)81 wsiydioussjod “ener Ul t Palo Ue Smale LUsi4jdioLudjog * (¥) anyen (9) "wo wou, © yo swusuunle pue aweU ‘adh, uanoy (py! POUIER J28n & 9} “qy) vonuassy Jo uonel ayy Busodea "Tpalgo ue yo sie}ap voNeTUaUIa;dWHT aU BUY aL O} ¢4: “Suu aldyynud UO axe} 04 ‘B50Kf JO BUOY (P} ssamppy (a) onauny eyo awit (Q) 7 uonouny e yo anjer ee Ueajoog (9) ‘ sueau adhievd =: a}00q (a) nvak 250110 340y (py MYOIBG 344) ueajo0q Yaryyn 04 sseI7 ALE ins ssejaang (q) *Be9ed aes u sassela pue ss¢l S52N, 0 BUON (0) raRUMU ey ejDES fo) GG) 93M05) | weve jaws ® scanned with OKEN Scanner tor'toot (e) juud ano waysts Ino wa}shg Ignog = A ajqnop yoanrenva8a}uy = x uy d sTO0T, = s Buy seu (p) ePayndax9 812 juBLUZas apoo Bujmojjo) atf) Lay"A yndyno Su a is © arqnop (9) a neu wanes (P) 2" LUYSAG (2) oz (P) . , , (wopuey pew (p) ety 4 T ue Q uBanyag anjen e vamos jim SpoyjaLs BuIMO|O} AU) JO YDILAN (UA) aU] J0 BUON (p) (@) pue (e) weg (0) pee 1 {SaBey2ed auuos ul day pue JayicwoD ener 2u u PaUyep Apease axe spoyja Jo sad Suimo}}0} ay) Jo YoKym SZT (P) TO (2) oft 2 pul Ua ‘OT = sau 40 BUON (P) (o'0o]e 30H (2) (03 UI S| BuimOqO) 347 JO YOIYAA (AL) Uuojssanuon adky (p) 8 0 tuonexei2aq adh} eyep s8yjoue 0} anjen edfy eyep auo aBuey 0} ssazaid s) Sumo) sau) JO BUON (P) ‘oyons)su09ggV (2) 2SSe)9 aly AlN JO 20}IN:3SuOD a4} Suasaican BuImo}foy uA JO UOIYAA ‘sayy JO auOU (p) ‘$82/9 (2) syaalgo ( \ leo syed [jews oqu) apo> werBo1d au) syids SuuweABord jeunpand), 02) “T uonsany Cuonaag siyy wou suonsanb yo duany) W-NOILOaS “{] siayooiq uy uaai8 aap suoysanb fo siuod 40 suonsonb sof syapuu popuaruy 21, {d uonjoas wosf suonisonb snof up puv y woes wo4f suonsonb yo rdwony -suonnag ony oxy paprarp st adog SY “suamsuo ay? Sunym Jof pe) fo poay 94) 10 uany8 aun ay sadod uowson! -somumu gr assy y? “Ayprnandas popraoad sodod 242 U0 suno\y 06th oor 3201 SNOLLYOIddY H3LNdWOo (GAA108) Z YadVd ATdWWS > ® scanned with OKEN Scanner MANE LE PAPER 5 co (SOLVED) MPUTER APPLICA TIONS Time atlowe ‘A to write durin must be You wit ePaper provided separately, ng the first 15 minutes, SECTION-A (Attempt all questions from this Section.) 1. i ty character literals from the following {20} 5 (oat se ne 27,b= 4 then frokb ests on ad ; (b) 3 i 2 Vieual Machine is a/an poe 2 My interpreter () Compiler i i nah of the following is a Java access specifier? Oeste cose O Ere ceve Mista (b) void (© private man {y Quput ofthe statement "TRANSPARENT: compare to TRANSITION is @il (9 19 7 a) Which principle of Object-Oriented Programming implements Reusabilty? (2) Data abstraction (6) Inheritance (c) Encapsulation (@) Polymorphism vi) What is the Jeva expression for the follawing? ax*4 +bxz+d; (a) (a Math powtx,4)ty) + (béx4y) +d; (b) (a.Math.pow 4(0*y).(b4x+y).d; (0) f*Math.powls,4)*y)H(b*x*2)+d; (4) None of these 4a) Which of the following are invalid variable names? en (0) double (©) 12a @NA (6) ‘Which function finds the number of elements in an array? te length) (b) tengti (©) count) (lent) li Which of the following techniques is implemented by dividing the array into two halves? (a) Linear search (b) Bubble sorting (©) Binary search {d) Selection sort {il Which of the following is the correct usage? (a) a (40) int (b) int al40) (©) (40) tat af) (d) None of these {i What is the default return type of the function math.random()? faint (0) float (c) double (6) char 4) Parameters used in the function call statement are known as {2)Detined parameters (b) Passed parameters (c) Aelual parameters (4) Formal parameters {i A package is a ' (2) Collection of data : (b) Collection of functions —(c) Collection of classes. (d) Nested class IS) A class obj ject is also known as . . ' {) Identfer (b) Instance variable (©) Specifier (@) Modifier @ scanned with OKEN Scanner SAMPLE PAPER 5 (sowveny ff {ip vold sumseries ( ): to find and display the sum of the series given below 1 1 1 14243 1e203ed "Tay 30an 10 i +2 question 7 1m to inpul a word in Upy e ie position of the first occurring vowel a Write a program to inpul a word in uppercase and check for thi 7 sition of the first occur i Wa vowel and perform the following operation. {) Words that begin with a vowel are concatenated with “Y". e.g, EUROPE becomes EUROPEY, ek, es (ii) Words that contain a vowel in between should have the first part from the position of th followed beginning till the position of the vowel and is concatenated by "C", e.g. PROJECT eenmes (Erp CBee 0c, {ii) Words which do not contain a vowel are concatenated with "N". e.p,, SKY becomes SKYN (05) question 8. A disarium number is a number in which the sum of the digits to the power of their respective position is equal to the number itself. e.g, 135 = 11 +3? 45° =149+ 125 = 135 Hence 135 is a diasarium number. Write a program to generate and print all the disarium numbers between 500 and 1000. ANSWERS & SOLUTIONS SECTION - A 1. @ (i) @) (ui) @ Ww) © W @ (wi) (b) (wil) @ (vit) (b) (x) 6) © (b) (ail) © (xii) (© © (xv) () bovi) @) (xin) (@) (x) @ (ow) () 2. (i) Z=Math.abs(Math.log(S00)-Math.exp(3"x)); (ii) (a) Ourpur : infinity (because base is zero and exponent is negative). (b) Output: ‘aN (IF base is negative the exponent must not be non-integer value). (ii) (a) When v= 1, the control falls through case 1 to 4 due to absence of the break statement. ©. the output will be the value of m= 39 (b) When v=0 the control falls through ease 0 to -2 due to absence of the break statement, Output will be the value of s=-6 (iv) The ‘new’ operator is used to allocate space in the dynamic memory and returns a reference to thar memony Itis used : (to create an instance of a class (i) to instantiate an array (y 280 281-282 - g 1g0 181 3 0s0 in xecutes 3 times: 2 a a ‘The outer loop executes 4 times and the inner loop e (vi) 10 8 10 12 (vil) 12 14 18 20 LIEN @ scanned with OKEN Scanner [IDI varsat. 1c COMPUTER APPLICATIONS HANDBOOK Ch SECTION-B is Section.) (answer any four questions from this ) Math.pow (-5, 2.3) {ili) Give the output of the following code when (i) v = 1 (ii) a int m= 10; 8 = 5 switch (v) { case 2 case 2 case 3 case 4: System.out.printin (“The value of m=" + m); break; so = —stmst2 +m; system.out.printin (“The value of s=" + st); case 0: case-2 break; I (iv) State the use of ‘new' operator in Java, (v) What will be the output of the following loop? Also state how for (int x=2; x 4 x) { for (int y=( { system.out.print (x#"$"+y+" "); } system.out.printin(); } yH) ys @ scanned with OKEN Scanner SAMPLE PAPER 2 soLveD) Eff Madan pint the Su ofthe une N ad perform the foling ue {in Check whether N is palindrome or not pisplay output with appropriate messages, gestion 5. Write a program to input any ten word: Display the sorted array. tion 6. Write a program in Java to acc, each word. Print the output in ek Input : Honesty is the best policy OUTPUT : HITBP. uestion 7. ‘Write a menu driven program to ee Benerate the sum of the following series according to the user's choice MS= T+ Ht at Ht M tems @s-2-4, Si o "nan array. Arrange them in alphabetical order using the Bubble Sort meth: ept a line of text from Uppercase followed 0 the user and create a new word formed out of the first lette by a full stop. westion 8. Overload the method void cale_volume ( ) to perf et ane uee perform the following functions Volume of Cone (1/3 xh) Volume of Cube (side) ANSWERS & SOLUTIONS SECTION - A 1 0 @ @w) @) Gi) @ wo “@ (wi) ©) wi @ (wii) ©) © @ @ (i) (@) (xi) (© (xiii) (b) (xiv) (a) Ow) (0) (xvi) (a) wii) (a) (iti) @) (xix) (0) (9) © 2(i) a=3 a-satt++4a+ay = (atte Hat a) 3-@+5+5) =3- (13) =-10 (i) (@) a=28b= 29 The else part will be executed as a> bis false b-=a p=29-28=1 Loop terminated | | Sinceb=1, | = UNE | Ans. true (b) Ans. false. @ scanned with OKEN Scanner d ==q z = ei z = z 5 (ace)35 } (req 79 ice) OTTUA fesTez=0 weatooq } (@ aut 'e guy) estegenza uestoog oFTqnd fal ue (|) Ul uaniB Se palied s1 (Jasjeyansy pouyaw SuIMO}/o} fa eres ese “Z wonsanp ‘anu S| (4) uoseay pue ase) st (y) uoIassy (0) “25]e) S! (y) voseay pue ann si (y) uorassy (9) “() uotrassy 0 uoneue|dxe 3281409 @ you S| (y) Uoseay PUe ANH are (4) UOSeaY PLE (y) UOIESSy WOE (a) (W) uoRassy Jo UONeUE|dxe 193109 e SI (y) UOSeaY puE any axe (y}) UOSeaY pue (\y) uorpassy \jog (e) (ZU}O St wos vonsEsuI pue Hos uor}2aj—s yIOq Jo AurKaldWod aI]: (y) uoseay “POS uor}Dapas UeY) aw ssa} Saxe) 0S UONASUI 22a (P) 25124 (9) PIYM mojaq PS Slexeyy ALA AINUED) OBumsoYyeOI4 (p) ()Su07asied-Bu07 (2) jasiedsaaquy (2) 280K) eyep saBaqu! anni e spanuoa jeu) poyjaw y (us) LP) 9 (2) st (e) sAuinyas OL => ayn { ieex=-K Ht yop fog=A'z=xn ap|aunyas 2q |IM4 anjen yeyNA Za\nd—x@ doo) SuMmolio ay “ani uoseay pue asi ‘sje S! (4) Uoseay pue anu si (y) UONaSsY Uvorassy 40 UoHeUe|dx@ 1281109 e jou S! (Y) UOSeaY pue aNN ase (4) Uoseay pu (¥Y) UO! (9) vores 0 uoneue|dye 931109 & S| (4) UOsesy pue any axe (¥) UOSeaY ue (Yy) UONASsY HOD 'W@54 $S2/99NS J0 Jo}an»}suU09 ayy ‘sse2qNS auf Jo ¥ Bunesso aus Apo1dw payonut YOU si Ssei9 Jedns Jo Jo} NNSUOD ALL 194 24g yur payonul s) ssejo sadns ay) UI pauyap yr Souuy AuUEUS OH SUL “SSe;2qNS au 40) 122! Puonsan, sens uoiassy S(P) B00) ¢ 5219 Jo au0u (py raalqo (9) adh e1ep (a) #5248 39 5u0N1 (p) 92 (9) zm 542) 9 wou = (I ial He yeu EB 2m) 2 uaave stays ® scanned with OKEN Scanner 5 2 = S J) vaTSAL ICSE COMPUTER APPLICATIONS HANDBOOK 3 state lions: y & (a) rouni - 6 (iv) Translate the given Condit into one using the ternary operator. gy = 4(Ve2000>1100) 3 x = ke10; 3 else 2 = k= 10; 5 (v)_ What is output of the following code a g String s-new String ("Computer 5 String str="Science" & System.out.print1n(str.substring(3,6)); System.out.printin(str.concat(s) (vi) (a) Wiite Java expression for the following ¥ = sin (log (VIS = 3); (b) Evaluate the following i value of x = -10 and y = -21, System.out.printin (Math.abs(Math.maxiNath.minix, y), ¥)))i Write Java statement to initialize an array x with the values : 1, 2, 3, 4, 5. (2) State two uses of break statement. a (ix) Differentiate between entry-control and exit-control loops. , (2 (3) Write a conditional statement to evaluate the grade ofa student. Assuming the total marks obtained is greater than ‘550, student is given a grade “A”, otherwise a grade “B" is given. 2 SECTION-B (Answer 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 description/mnemonic codes so that the logic of the program is clearly depicted. Flowcharts and algorithms are not required. Buffered Reader / Data Input Stream should not be used in the programs. (5) uestion 3. Define a class BusFare that has the following class specification + Instance variables = to store bus number String num — String name - to store passenger's name int km - to store kilometers travelled double fare - to store total fare Member functions : BusFare( ) — constructor to initialize num to 0, name to “", km to 0 and fare to 0.0 input () — to input from the user num, name, km calcFare () = to calculate bus fare for a customer according to given conditions : ilometers travelled (km) Rate/km 10 km Rs. 5 10 40 km Rs. 25 show( )—To display details in the following format Bus Number Name lometers travelled

You might also like