You are on page 1of 21
teen sven. snscans — Qsmoven (oma es cnn naan te Pp Seca A 8 Solved 2012 Question Paper ICSE Class 10 Computer Applications | x. te Aptceson [a] ") ‘Scone Apter ———-| Works Where You Write o- Ea ‘ssved202 erin Paper Eee? mp foes 5 Section A amuteeopntrs| ‘uestion 1 (2) ive one example each ofa primitive data type and a composite datatype. Answer tint 2 aay (©) Give one point o aference between unary and binary operators. Answer unary operators operate ona single operand whereas binary operators operate on two operands. (¢)Diferentiate berwoen call by value or pass by value and call by reference or pass by telerence, ‘calby value ‘calby reference Values of actual parameters are copied to Reference of actual parameters is passed fecal parameters. ‘0 ermal parameters ‘Changes made to formal parameters ae not Changes mage t formal parameters are tefleciod back o actual parameters Fefecod back o actual parameters. () wets a Java expression for Jeet Answer Mateqit2*a*s+ usu) (6) Name the type of error (syntax, runtime ological error) in each case given below: 4. OWision by a variable that contains value of zero, 2. Mutpliestion operator used when the operation should be division. 1, Runt eror 2 Legal eror 3. syntax eror Question 2 (2) create a class with one integer instance varlable. Initialize the variable usin 4. default constructor Answer clase tober ¢ pone mater) pone nater(sat 2) ( > (©) Complete the code below to create an object of Seanner class: ‘Seanner se *__ Scanner. i ‘Seanner 20 = new Seamer(System in () hats an array? Wit a statement to declare an Intgé Answer An array 2 stucure fo stoce a numberof values of the same data ype in contiguous memory locaton. The folowing statement decaresanintager array of 10 elements: Int ar * new into}: () Name the search or sort algorithm that 4. Makes several passes through the array selecting the next smallest tm nth ‘2h time and pacing It where It belongs in the array 2 Ateach stage, compares the sought key value withthe key value ofthe mile lament ofthe aay Answer 1. Selection Sort 2 Binary Search (e)Diterentiate Between pubite and private moaiters for members ofa class. ‘Answer ube mocfter makes the class members accessible both within and ouside her lass ‘whereas private moat makes ine dass members access only whine asain which they ae dectared ‘auestion 3 (2) What are the values of x and y when the following statements a tne a= 8,0 = 8: fooleen x (a 8)? true: false: ireys (acta answer ouput ‘The trary operator (a >)? trues False retum tUe a8 fs concton a > bs tve sot retums i rst expression thats ue, ‘The teary operator (a « b)? a: Fetus b sts condition a< bs fase so eturs ts second expression tat sb, Value of bis 3630 also becomes 26. (©) State the values of mand ch. ther eh = ohare answer Value of mis 66 and chi ‘ill be converted tots ASCII value 65.1 + hore due to impiet converson, ‘ded to it mating the value ofr 66. char ch = (chan. hare trough expt conversion 6s convert tots crrespandng character hat 8 so value of ch becomes 8 (ey Winat vi be the result stored in x after evaluating the fllowing expression? roe « (oon) + Answer xen oe) + (remy Sx ce (ee) + (44H) 49) +4646) ere axe20 (4) Give output ofthe following progr segment out point in(Math win(Math Aloor(x), 993 sot prdnen(hetn. auth c081(8), 9))5 [Mats oor2 9) gives 2.0. Math in(2 0,25) gies 20 Mat) eoi(2 9) ges 30. Math max(3.0, 25) gves 30 (e) State tne output oF te following program segment: inne sen; syaen oct. prineln(s.strteneh(s substring’, 932 Syn oct prinln(s ante) nz chores) answer ouput xplanation Pring the value of nn s.subtring(S,) becomes s substing(, 11). This gves nation” AS ‘eno sta wn “nation” 50 strains sbsting(,n)rtums tase ScharAt2 Is aand s.charA6) is also a so bot are equal (0 State the method that: 1. Converts a string oa primitive float datatype. 2 Determines if the specified character Is an uppercase character. Answer 1. lost prseroat) 2. Character isUpperCase() (o) State the datatype and values ofa and batter the following segment i executed Sting ob = “Conuter", 02 = spensetsons™ fo (otconpareo(s2)): answer ata ype of ais int and values 2. Data ype of bis boolean and values ls. (¢) What wil he folowing code outpt: String 2 = Conlaystent; et prinen(s denon") ot printn(s stinger) “Te frat m appears at nde 0 andthe last m appears at incon 8 (0) Rewrite the folowing program segment using while Instead of for statement. for(i nH dee 8: HIE ‘Answer tate (hee Syocn.o.prinei D4 (Inthe program given below, state the name and the value ofthe: 1. method argument or argument variable 2. class variable 5 local variable “Instance variable clase myelseet state ine x= 7 ole sttse vote nain(stringsrestC cass obj = ne RyebsstDe Sparen cot optnein)s cop sareleethes=): Spat cut. prtatin(s , ‘ot sarpleethotint 9 syaten cut greta): ‘syste oot pri MeiN) Answer 1. Method argumenArgument variables 9 2. Class variable fx 3. Local variable a 4 Instance vans sy Section B ‘uestion ¢ Define a class called Library with the following description: Instance Variabls/Data Members: Int aceNum — stores the accession numberof he Bock ‘tng tle — stor the te ofthe Book ‘Sting author — sores the name ofthe author Member methods: 4. old nput)—To input ana sore te aooession number, ie and aur 2. old compute) — To accept the number of days lat, calculate and splay he fne charges atthe rate of. 2 per cay 3. vold spay) — To eepay the detain he flowing format \Wte 2 main method to create an object ofthe cass and cll he above member methods, answer ‘ oe soput0) ¢ Seanar Ah = nas Seanne(Syaton. tn) Systen ov. print (enter babe ttle); title = insentines Syetancot grume(antersuthars“)p sitbor = in nerene() Spat cot orane(enter secession suber: seein = Innes , vets corps) ‘Seaner in = pen Seamnr(Systen. in) Spot oot rine (tnternanber oF 4a Takes“): ine ave = Snsnettne Os ‘jeter out priatin( Fine» 24 ein vote alent ¢ ‘spate cut. printn("Accssion anbereTsee\ thon” Syria ovtprintinocohn "Ve" + Eltle = "Ve" = autho: > able state vo nainString ares) { arary tf = brags Shine Shem > > ouoet Bbc emelwosee at =e x tn lenter book title: Glue Unbrelle lenter author: Ruskin Bond lenter accession nunber: 12023 lAccession Nunber Title Author 12023 Blue Umbrella Ruskin Bond lenter nunber of days late: 5 Fine = Rs.10 uestion 5 Given betow sa nypotnetical tale showing rates of icome ax for mate ttzens below the age of yoas: ‘Taxable income (Th n& Income Tax in ® Does not exceed Re. 160,000 “ Js greater than Ro, 160,000 and les than or equal to Rs. (11 1,80,000) x 10% 500,000. Is greater than Rs 5,00,000 and es than or equal io Rs. [71 -5,00,000) x 20%) + 300,000 34,000 [cr 8,00,000)x 30%) + 1s greater than Rs. 800,000, oe i 94,000, ‘ite a program to input the age. gender (male or female) and Taxable Income ofa person tte age s more tan 65 years othe gender I female, play rong categoy” Mine ages less than of equal to 65 years and the gender is male, compute and splay he income tax payable as per the tate given above Answer scone Sovaute.seanners ‘ pode static vis sain(string ores) ¢ Seaman in = nan Seanner(Syeton Im Spree out. prine(Entercanae(aale Fmt) °)5 String gender = inertia Sper cut orine(enteragt= Soo age = snneetzn()s Spot cut grsne(enter Tauabe Tecan: *): douse th = insnetbowes 6 (oe > || gender euatetznorecve(fnsle™)) Syate.ovt print (Wrong Category"): > mec ‘SF (oh ce 69096) tee Lf (et cx soeze) arr (th = assess) * 38 / 108; ise fF (eh ce see) ear 2 8800 + (RE ~ 50000) © 20 / 200): syaten.out print. "Tax Payee: 7 6 00) “Bel eral Window 8 =o x ones Enter Gender(male/female): male Enter Age: 50 Enter Taxable Income: 750000 ‘Tex Payable: 84000.0 “Ber eral vinacn ns cee omens Enter Gender (male/female): female Enter Age: 25 Enter Taxable Income: 1000000 Wrong Category ‘vestion 6 ‘ite a program to accep a sting, Convert esting nto upper case eters. Count ana output ‘Sample Input "SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE" Sample Output 4 Answer pelle class Ktombettrieg ‘ lle stase vo main(String ares) { nen seamen: in) rin rencer see" String = innettine( String ser «2 saveperase) ine ams ser-logth() for (int £20; Lc 2en 35 44) ¢ 50 (ot chaie(s) mete eharath 2) > ‘yet out print “Double Later Sequanes Count = + count Beate wa = ae cote | Enter string: SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE Double Letter Sequence count = 4 ‘vestion 7 Design a clas o oeroad a function polygon) as folows: +. vod polygonintn char ch) — wth one integer and one character type argument o raw 3 ‘ied square of side n using the character stored inch 2. void polygon x n'y) — with two integer arguments that draws a led retangle of length x and breathy using he symbol. 3. old poiygon) — wh no argument at draws Ml angle shown Delon: exam: 4 Input value ot n=, en =o" ape 00 00 2 Input valu of x= 2, pur: eeece eeece 3. Output: Answer pense clase Kbosrotyeon ‘ lic vos pelygn(int ny cer eh) for (ineiet teem ia) { Systenaut-pne (ens 2 Syatenout printing: > Pole ve podygn(ine ay St 9) ( for (inet ety beets 4) { for (ne $235 $ cos 5) system aut sae): 2 Syotenout einen: , pole vse potent) ( for (net nts 4 e231 $00) ( for Gre fe ap Se te 5) ( system out print): > Syetencut pinta: : polic static ve natnstring ares) £ oeetheiygano65 = ne NbentPoy gen: cepaiygonta, "075 Spete cut printing) co. palygotas 3 Syeten cot printing): cs palveon): , > ouput Ae Win 2222 ton ‘00 ‘00. ‘uestion & Using @ stn statement tea menu driven program 16: (@) Generate an eisplay the frst 10 ters of he Fibonacci series 0412.85 ‘The fat wo Ftoonace numbers are 0 and 1, and each subsequent number the sum othe previous tuo. (©) Find he sum of the cigs ofan irtegr thats input Sample input: 18300 ‘Sample Output Sum of the cats = 18 For an incorrect choice, an appropiate eer message should be displayed Answer public clase thontribomee oigitsin ‘ pole stase vo main(String ares) { eee ea Syeten cot orine(enter jour totes ine eh = dn-netine teen (00) ouput ‘yates out prine(a + * t+ for (ie tn 3p 4 co 38; Sor) ¢ shaten aut plnt(> © + ter): > Sprten out prine("nter numer: Soe m= inne): Syatan cut prsntin'sun of atgies + yet out grsntinuacorsct totee"): BBall Wate Hp = cpus 1. Fibonacci Series 2. sun of digits lEnter your choice: 1 011235813 21 34 “Be en indo 8 on 1. Fibonacci Series |2. sum of digits Enter your choice: Enter number: ‘sum of Digits 2 15390 = 18 ‘avestion @ ite a program to accept ne names of 10 63 na single mensional sting aay ane her ‘STD (Subscribers Tank Dialing) codes in another single dimension inleger attay. Search for the name oct input bythe user in het. the name of he ety long wt ts STO code, Uunsuecesstu no suet cy nthe st Answer Ione Seveutt. scanners ‘ bie strie vid eai(string ast Sconer in = ner Seannr(Syeten i String cites[] = ev Strings String stdcodes(]« non Sern St Spot cot prinen(vereer™ * Ciedes ana their S7 for (int L205 Le sae Soe) Syrtenout pine Enter ty found splay "Search Sucesstu and pint cr ese splay te message ‘Search 4 m 1 20: awe: “Ys ‘Systen-out print("Eneer itz STD Cade: ")s stecoees) = sn-ereie| > > syeten cut orine(Inter mane of ebty 2 serene String chy = SnnertLinet)s for (anv 8; tte « #128; tue) ¢ SF (city. conparetateorecar(cSte(sox)) = 6) > > 6 Gin cat) Sprten out printin"Searh Sucesef" Sprtenout granein(eiey: * + etie See): Shatenovtprintin'STD Cotes = stcetes 4) 2 ae ‘shotenoutprintbn("seareh Unuccessal"); > ouput BD emit Won 35.50, orton Enter 1@ cities and their STO codes: Enter City Name: Delhi [Enter its STD Code: 11 [Enter City Name: Lucknow Enter its STD Code: 0522 [Enter City Name: Dehradun Enter its STD Code: 0135 [Enter City Name: Anritsar Enter ite STD Code: 0183 [Enter City Name: Ahmedabad Enter its STD Code: 679 [Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter City Name: Bhopal ite STD Code: 4755 City Name: Guwahati its STD Code: 0361 City Name: Chennai, ite STD Code: add City Name: Bengaluru ite STD Code: 980 City Name: Hyderabad ite STD Code: 040 hnane of city to search: Guwahati ‘Search Successful city: Guwahati ‘STD Code: 0361 € Solved 2015 Question Paper ICSE... Solved 2011 Question Paper ICSE C. >

You might also like