Download as pdf
Download as pdf
You are on page 1of 21
coat Aponte ‘saved 20 sion Poet SE C861 Compt Sotatane mute Aopen ‘ome Aeron Solved 2013 Question Paper ICSE Class 10 Computer Applications | ox, is} ———-| Works Where You Write eo Ea Section A ‘uestion 1 (@) Whats meant by precedence of operators? Answer Precedence of operators refers othe order in thich the operators ae apie ta he operands in an expression (©) Whats a tera? Answer erate ave data ems that ae eed dala values, Java provides ferent types of ier ie 1 imeaer teats 2 Floating Post Literals 5. Boolean Lterale 4 Character Literals 5. Sting Literals {e) State the Java concept that Is implemented through: 1a supercas 2 the act of representing essential features without including background deta subclass, answer 1 inheritance (4) Give eference between a constructor and a method. Answer CConsirucor has the same name as classname whereas funcion shoud havea diferent name (e) hat are the types of casting shown by the following examples? 1. double x= 15.25 ney = in x 2 intx= 12: Yong y =x: 1. Exp Type Casting 2. mpc Type Casting ue ion? (a) Name any two wrapper classes, Answer “Two wrapper classes ae: 4.mteger 2. character (©) Whats the diference between a break statoment and a continue statement when they occur ina loop? Answer nen the break statement gts executed, terminates is loop completely and conto reaches to he statement immesaaly toloning the loop. The continue statement terminates only he ‘eur eration ote oop by skipping resto te statements in the body othe oop (ey Wie stetements to show howe finding the length ofa character array char] ditfers {rom finding the length ofa String object st. answer Java code snippet to tnd length of character aay. char eat) = C2 2) Java code snippet to find length of Sting obec st seeteneth () Name the Java keyword that: 1 ndleates that a method has no return ype 2 stores the adaress of the eurrenty-clling object. 4 veld 2this ()What is an exception? answer ‘An exceptions an abnormal condon that arises na code sequence at runtime, Exceptions Incleat oa caling method that an areal condon has occured, ‘Question 3 (2) Wie a Java statement to crate an object mpé of class Digital Answer Digital res vow igiealOs (©) State the values stored Inthe variables strt and st2 String 62 = “werke matters” String sted = s2ssubeteg(s) replace t's 0): Sting eed = sheonceeatet Answer Value stored in srt is* manners" and sis "ood manners (Noe that srt begin witha space.) s2.substrng(S) gs a substang fom index ithe end ofthe sting uhich is * matters" The replace method tepaces al" in* mates" with Wy gkvag" manners" 1 conca(at} jens together “goo and" manners so "good manners" is soredin st (e) What does a class encapsulate? Answer ‘Aclas encapsulates data ana behavior (4) Rewrite te following program segment using the if.ese statement: com = (ene > 28800)? sate = 5/308 santa > 15000) (6) How many times wil the following loop execute? What value will be returned? ac ee aslagn co 30) “The loop wi run 5 tes andthe val retuned is 15, (oWhatie the datatype thatthe fllowing lbrary functions return? 1 sWhitespace(char eh) 2. Matnrandom) Answer 1 boolean (e) Wrte a Java expression for: ub She 2 Answer urter2orret (0) tint ng = (8,2, 3 5,7, 9, 19,16), what are the values of x and y? 2. Math powto(h, nD; y= Math sqrn(8} + nf7D; Answer = Mat poor Math pow, 9): 30; Math sarin + 7 Man saris + 16) (0) nat sth final value of tr when the eration process given below, executes? fortine Leas dees 109) fortin §= a; $c 55 4 = 2) Answer “Te ral value of ris 16. ‘The outer loop executes Stimes, For each teraton of cuter oop. the inner lop executes @ Limes, So the statement +c executed a total ot 5x5 * 15 times Answer a) 2-nextune() Section B ‘Question ¢ Dein a cats named Frutluice wi he following desertion Data Members Purpose intproduct_code stores he product code number ‘Sng favour stores he favour of he ce (e.g. ange, ape, ete} Suing pack. type stores te ype of packaging (e.g. tr-pack, PET bot, et) intpack size stores package size (2.0, 200 mL, 400 mL ec.) Incproduc_prce stores he price ofthe product Member : Methods isiana! constructor to itilize integer data members to 0 and sting data Fretucet) members 0" {0 input and stor he product code. avout size and swing) ss ack ype pack: product pce void discount) to reduce he product price by 10 to dsplay the product code, favour, pack type, pack ze and product vod deni) ee Answer ‘ petste Sos ores coe Peivate Serine peetpes Fate ine pret staes Feinte ine proae pees pubic rrutanicn() { packsipe = ? pale vole Snowe { Seaman Sn naw Seanne(Syaton. tm) Syeten.cotgrine(Enter Flavour") Piavour = innertiineOs Spat cot prine( Enter Pack Tye4! prckcope = tn netuineOy Spat cot orune"Enter Presut Case: "D> rodrtacode = inametineOr yet cot rine enter Pace Sie: feckstse sn nesine) Spat out. print (tater Prewct Pres“); prosuct price = nvnertnt , tic vd discame() { i 7 polis vos sist) ¢ Syeten cut print "Prosct Code: * + presi code); Spree cot prinen(*Flmour= "+ flavour) pete out prinein(“Peek Type! = + pak 08): Spat out printin( “Peek site: "+ pack sae): Sprte out prinen(-Proguct Price: *» proce shee): , public strc void eainstringorest) { rutcusee otf = ou Frasnetea(): as tpt 5 ncoues A Diem Woden 8 =x on Enter Flavour: orange Enter Pack Type: PET bottle Enter Product Code: 30 Enter Pack Size: 750 Enter Product Price: 6 Product Code: 30 Flavour: orange Pack Type: PET bottle Pack Size: 750 Product Price: $8 ‘avestion § ‘The ntomatioal Standard Book Number (ISN) 2 unique numeri book tent whichis printed on every bock. The ISBNs based upon a 10-cgt code, ‘Te 1S8N is legal TH ight +2 gia +3 891s +4 x ight +5 «eg + 6 dgH6 +7 BT + 8x gH + 9 dgtd + 10. digt1D i disileby 1 Example: GUm=T N16 2xd49N OCA KT +SxGSEKONT HERR 69x94 1000 #289 uhich Is vate by 1, ite program to: 4. Input he ISBN cose a8 10.9 integer 2. the ISBN isnot a 10-9 integer, cuput he message“ rogram, 8. the numbers cvisibleby 11, output the message "Legal ISBN” the sum snot isle by 1, ouput he message “ilega ISBN” 2 ISBN ana terminate the Answer Aron Sovnutt. seams ‘ poe static vie sat(string sree) { et ieee tera Spano cot orsne(eneer she 1800 ang fsbe = se necuong(); sate (sete Ie 8) Sot d= (in)(ieba 28); > 26 (ene 1229) Syete cut grsneha(abaat 2550): 2 See (on 1 20) ‘shotenout prSntin Lege 25807) By te ‘sjeten. out printha(ahgad 1580); > Bir emia Wes 58 > 9 x a [Enter the ISBN: 1401601499 lLegal ISBN inal Wess =o x os lEnter the ISBN: 1401601500 ‘Illegal ISBN ‘vestion 6 ie program that encodes 2 word nt Pplatin. To tanslate word into Pilati word, convert the word into uppercase and then pace the st vowel ofthe orginal word asthe start of the ew wor along withthe remaining aiphabets. The alphabets present before the vowel bang shite toads he en flowed by “A. Sample Input 1 London ‘Output ONDONLAY Sample Input 2: Olympics ‘ouput OLYMPICSAY Answer ‘ bie seese vod watnstring ares { Sanur in = nan Seamnee(Sptten. in) Spann cot ortne(eneer wate"): String words snnect() ine dn sword onathO soresers toigsercste( forint $2 6: £ ¢ ten; $44) t chor + wrdschrst(@s Seen nent |] 2 | neo" |] 2000) « plezeinovora. substring) + vora.suesteine 88) + “Ar: > > irene = 0) ‘ PheDein = ard © “a Ey Syeta.cutpriatin(aord +" in Pighatin forme Ss * + plata “Biel Wes 6 =o x optone lEnter word: London [LONDON in Piglatan format is ONDONLAY “Amal Weson 6 Sai: opto lEnter word: Olympics [OLYMPICS in Piglatin format is OLYMPICSAY ‘vestion 7 \ee program to input 10 ntagar elements in an say and sot therm escencing err using bubble sr teennque Answer Icon Sovnutt. scanners « pobie state vie sai(sering sree) { Seaman in ner seamertepecen- in) ne ert) ne neo ‘yer cut prtatin(venta the for (nt tro em ion ¢ seri = Lnnenttne; > for (nt ine ten s{ for (ink Jer jena 1s dh) AF ares] caret © 1D ine t= enti, sec sees, wngal st > 2 > spot cut. printing "Sores Ary") forneiee temic) ¢ Syrtencut arinelam(s) +") a > ouput Bah eral Window 6 = aces Enter the elements of the array 15 5 7 un Sorted Array: 201915 1413118765 ‘Question 8 ‘Design 2 cas o overoad a function series )s folows 1. double seres{couben) with one double argument and retums the sum ofthe sans. su = (11) + (72) (18) #0 CN) 2. double serce(doubo a, double n) wih wo double arguments and returns the sum ofthe sun» (a2) + 498) + a) + (20!) + to termes answer pense case mbontseriee ‘ ou seres(cousie 9) ( for (in Date Lem a4) nun term = 2.0/§) > , eu sarea(coubie a, saute») { for (ne tet: teem 8) ? pole state vo nain(String ares) { batserieg abs = neu Kontera) ‘yet ovtprinein(cPire tare sue =" 6 otfsertan())s Spat cot orinen"Secand teres tum ©" o8)-trdee(3 8))3 ouput Beem Wow 2 pte First series sum = 2.283933933333333 ‘Second series sum = 0.1286982248418103 vestion ¢ Using the suite statement, wie menu even program: 1. Tocheck and esplay whether a number input by the user a compesit number orn. [Anumber is sai tobe composite ifithas one or moe than one factors excusing and the numba oat Example: 4.6,6,9 2. Tofnd the sms gt ofan integer that snp: Sample Input 6528 For an incorrect choice, an appropriate eer message should be asplayen newer score java. utta. seams pense case Kbosthuner ‘ pic static vis nainstring ores) ¢ Seewar in = nen SemerCayeten.in) syrtn out rinen( "Type 3 for conesite nba ‘Syste out printin( "Type 2 for Snallest Digit"): Spete cut prine(Enter jour choice! ")2 inchs inert ine ste (09) Sioten out prine("nter amber: *): Ere n= insnnttneOs for Gane bn as bce mr dH) Wiat tow 8) 2 (00) System out printn(Componice Marte"): ‘systenoutpintannot 2 Composite Hanber*); Syeten cut grsne("ercer nummer: * Snes anneetie(): ne (nun t= 8) face 2 Syotenout printinrsnaiene ase f2 "+ 9; ‘Syete.ovtpSntnuron enor): A Bieri Widow 25 opto ‘Type 1 for Composite Number ‘Type 2 for Smallest Digit lEnter your choice: 1 lEnter Number: 9 (composite Number Bn ona ina pat “ops ‘Type 1 for Composite Nunber ‘Type 2 for Smallest Digit lEnter your choice: 2 lEnter Number: 6524 ‘smallest digit is 2 © Solved 2014 Question Paper ICSE... Solved 2012 Question Paper ICSE. > wees

You might also like