Download as pdf
Download as pdf
You are on page 1of 21
Wwe eres (oma esc nnn anand 0 Gen PSE Cae epi Ecomate apart mute Appears Sete ame ueston Paper SE cero Compt spniestone Solved 2014 Question Paper ICSE Class 10 Computer Applications. |... is} ———-| Works Where You Write eo a Section A ‘uestion 1 (2) Which ofthe following are valld comments ? 1 Peomment! 2. Meomment 9. leomment | eomment') Answer “Te vat comments are: (option 1 —reommens"! ‘Option 3 — eomment (©) What is meant by a package ? Name any two java Application Programming interlace packages. newer |Apackage is @ named collcton of Java dasses that regrouped onthe basso her ‘unctonalty. Two java Appleton Programming Intetace packages ae 1 java wt 2 javaio () Name the primitive data type in Java that is: 1 a 64-bit integer and is used when you need a ange of values wider than those provided by nt 2a single 16-bit Unicode character whose default value Is 10000" Answer 1.1079 2 char (4) state one eiference between the leating polnt tras float and double. Answer oat iterate double iterate Toa tral have asze of 32s so they double erals havea size of isso they ‘can ser fractional number wth around 6 can store a fractonal number with 15-16 otal cigs of precision. ‘etal gts of precision (e) Find he errors in the given program segment and re-write the statements correctly to assign values to an integer array Int ao por tnt (8): fo (ine 085 195) 16) atts Answer Ccomectos Code nt af] = noe iets] ter (ime 1m es 46 85 1) at = ir ‘avestion 2 (a) operators with higher precedence are evaluated before operators with relatively lower precedence. Arrange the operators given below in order of higher precedence to lower precedence: 2% (©) Identity the statements listed below as assignment, Increment, method invocation or ‘object creation statements. 1. System out.printin( Java") 8. Carhybrid = new Car) «¢ pewrotPricess: 2. Assignment 8. Objet Creation 4 Increment (6) Give two aiferences between the sultch statement and the else statement Answer ‘witeh Itetse ‘suich can ony test ithe expression is _ielse can test for any boolean expression ike ‘equals any ofts case constants ess than, restr than, equal 1c, not equa, et. Its mutpe branching Pow of conto me Wis becrectional flaw of conta statement () Whats an infite loop? Write an infinite lop statement Answer [Aleop wich continues trating indefinitely and never stops i termed 25 nit eep. Below i an example of inet oop: Syn. ou. princi Tanke Looe" (6) ¥matis constructor? When ist invoked? Answer [Aconstructoris @ member methes thts writen wth the same name athe class name ands used to ntaize te data members or instance varables, A constucor doesnot nave a etn (ype. is ivoked atthe te of cating any objeto the class. Question 3 (a) List me varabies trom those given Below that are composite datatypes: 4. stale int: 2 aret=t0; 3. objeplay); 4 boolean b: 5. private char ehr; 6 String st Answer ‘The composie datatypes ar: + antie10; + ebiaspayd + tng st (©) State the output ofthe fot printn(stea.sunstring(,2) const (et2.cabetring()))2 fet printin( (oa = (aed subering) eapoertase)))); Answer “The output the above code is: ‘Explanation: 1. st substing(0.2) etums “gr str2substng() retums "nds" Due to coneat both are Joined together to give the output as "nds" 2st substring) retums “eat tis converted o uppercase and ined to "WH" o gue he cutput as “WHEAT. (e)¥mat are the final values stored arable xandy below? oubte = that. 01360); Gaube y = ath rine as ne Answer ‘The fra value stored invariable xs 6.0 and y is 180. xplanati 4. matnceiia) gues 6.0 ana Math 2096.0) 1860. 2 Math max{a.) aves 14.74 and Mathin(.74) aves 18.0. (4) Rewrite te following program segment using Ilse statements instead ofthe temary operator: ‘String grade = (marks>=90)7°A": (marks>=80)? "8": "Cc"; Answer (6) Give the output of te ftlowing method public static vie main(String (J area) System. ovtprintan(a); peeled = Cah System oct prinln(e);} answer Sxplanation 4. at eroment value of aby 1 89a becomes 6 2alany-(a) Sara ((a)-(a)) 3a=6-6-4) aar6-2 (Whats the data type returned by thet rary tunetions 4 compareTo() 2 equals Answer 2. boolean (g) State the value of characterstc and mantissa wen the following code is executed ine charactorictestatgurparsetat(s.cubtring(@,)); ne manessnotneger value(s. substring): Answer ‘The vale of characterises 4 ana mantissa 3756, Index of. nStnag $18 130 varable nis ntatzesto 1s substing(.n) gues 4 Integer parsnip converts sting“ into integer 4 and is 4 assigned to the variable ‘Ssubsting(net) gves 3756 Lethe sting starting at dex 2 he ond of .ntgervalueo) converts sting "2786" int ntager 2756 and ths value is assigned to the variable massa (Study the method and answer the glven questions. public vos sarplenathos() {tor (ae tne 35 40) (for (ine 3 = 8; 4a See) {Ene mumber = (de) RR randanc) = 2694 Syrten-ovt printer}: 33) 1. How many times does the loop execute? 2. Whats the range of possible values stored in the valable number? 41 The lope execute 6 tes, 2. The range is tom 0109 (0 Consider the following class: poslic clas nclass { peelic ine 2, Ba) 1. Name the variables for which each object ofthe class will have its own distinct copy. 2. Name the variables that are common to all objets of the class newer Day (0) Yona wt be the output when the following code segments are executed? o Steing 5 = s02"; int a= Dregeralen0)5 Ona valet o syeean oot prinen("The Hing sake \tagin the baste" €8 Re"): Answer (0) Te ouput ote code (i) Tre output of te code: ‘he ing cals “Eepin at th bepioniog* 20. Section B ‘Question ¢ Define class named movieMagie wih the folowing description Data Members, Purpose ine yoar To store the yoar of rlease of a movie ‘Siig itie To store he tite ofthe movie ‘To store the popularity rating ofthe movie Fest 099 mum atng-00 and maxim rating=5.0) Member Purpose Methods i ‘Default constructor ointalize numeric data members to 0 and String movieMogi() ata member to™ void accept) To input and store yoar, il and rating ‘To deplay ne tle of ne move anda message based on he rating a voi splay) sings Table Rating 00120 211036 astese 451050 er the table given below Message to be sloplayed Flop sem-tat Super ite @ main method to create an object ofthe cass and call he above member methods. Answer ‘ otic eovisagic() { , pale vole acca) ( Seana ne Seanne(systen. tn) Speco out rine (Enter Tithe ot Pov“): hele = inectine() Syatan.cot orune(anter Year of fees") ese secnsezney: Syeta.cut prune (enter ating = innertlent Os, , polis vis sisoln) ¢ ‘String neezge = “Tova Rating 6 (ering 22) case (ting meets = "AC sane fF (rating « 5.09) Spat out prinein(eae : lie steie vo wainstring ares { Enter Year of Movie: 2009 Enter Rating of Novie: 5.0 '3 Idiots ‘super-Hit ‘vestion 5 [A special two-digit umber such ha when the sum ois digits it added othe produto its igs, te results equal othe orginal wo-cigt number. ‘Example: Consser the number 58, sumofdgte =5 +9 14 Producto ais = 59 = 45, ‘Sum ofthe sum of sand product of ag 14445259 tea program to accept 2 two-igt number Ad he sum af ts gs ote produto ts gts. he values qual othe rumber input then spay the message "Special wo—dgit umber" ctherwis,cepay the message "Not a special wo-dgt number” Answer lic clase Khotspecatnuroer ‘ polis vs chectanberQ) ¢ camer in nen Seanner(Systen.in) systencut rine (Enter 2 alt nuber: )s ine argue = innate se (rue 120) (igstum = diet; > 4 (cam 122) Syoten.outprinthn"anvalis inut, please eter # 265g nonber")> ‘else at (lexgitsum + aagatProguct) as orgtun) ‘syetenout grancin(specian 2igie mater) ‘syatenoutprbntancmet tn, 2eighe mater” “Beet eral Wow 2p =a x Enter a2 digit number: 59 ‘Special 2-digit number Enter a2 digit number: 85 Not a special 2-digit number Enter @ 2 digit number: 4 Invalid input, please enter a 2-digit number Enter a 2 digit number: 512 Invalid input, please enter a 2-digit number ‘avestion 6 ‘tea program to assign a ful path and the name as gven below. Using brary unetons, ‘extrac and ouput he fe path le name and fle exension separately 25 shown put CcoUsersiadmin\Peturetoweripg ouput Path: CaUsersaeminPetres Filename: fower Answer ‘ pole stase vo nain(String ares) { scmar in = ney camer(3psten.in); Syenen cot grune(eneer full pets i ne pethsense « ilepath.Jestingerf (onto): Spat cut priatin(oPethe\e" > filepath abeteng(®, path soe sot20n = f8epatnasttesnot tse); Spat. ovtprintin(File Mane ie» Huapeth.subetednl oe +3, dtt00)5 syste out. printn(“Ertansion \t" + filepath. substring otéx + 1)); ouput Bier mil don 6 - ox owes lEnter full path: C:\Users\admin\Pictures\flower. jpg Path: C:\Users\admin\Pictures [File Nane: flower lExtension: Jp9 [ae er er orem ‘question 7 Design a clas o oeroad a function area ) a follows: 1. double area (double a, doubeb, double c wit tr ofa sealene mangle using the formula area = Wete-ays-d)¢-)) her ule arguments, retums the area (arate) 2 ovbie are (int a, int, nt heh wih thee loge arguments, etuns the area of 3 trapezium using the formula area = (12)heighva + b) ouble area (Souble lager, double agonal} wih two double arguments, returns the ares ofa hombus using the formula area = 12(lagonat x dagenai2) Answer ‘ owe ece(snosie a, dutte by dowie dublnes (eb 2135 Susie ee Goa) * (b) * (er tle case « rch ogee): : cube area (int, int by Ene helene) { couble result = (18 / 28) * bright * (@ +8): 2 cae ace (Gouble Siogoray cove sional?) { ouput ‘vestion 8 Using the sch statement, wie 2 menu criven program to caleuate the maturity amount ofa Bank Depost ‘Te users guen the folowing optons: 1. Term Deposit 2. Recurring Deposit For option 1, acept principal (). rae of interest) and tne period in years) Caleuate ana ‘output the maturity amount(s) cevabe using the formul: Par +11 1007 For opton2, secept Monthy instalment (Pra of interest) ane time peri in month (0), Cteuate ans output the maturity mount (A) receivable using the formula Pans Pxiojnet)/2) F100 «1/12 Foran incorrect option, an appropri ror message shouldbe dsplayed Answer soar Sorat. seamen: ‘ pole static vis nain(String ores) { Seanar in = nar Seamer (Spat. Systen out prinein( “Type 3 for Tere epost"): Spat cot prime "type 2 for Recurring Deport) Syeten cot orine(snter jour totee!"]3 Geen inner): teen (00) Ps inseetousleo Syaten cut prsne"nter fine én year: *) Po inaertntt)s wen pon(d © / 380, 92 inci natant aneunt =" +4) Syaten out dnt “ntar Monthy Instant: Syaten ave printEnearIntaree kates“) Syaten cut prsne'Ecer tine £9 onthe} ara) roe fame) 8/2. Syotenout printincneturlty aunt =" + 0); Syaten.outprintin("tnatle cotce") Ba onion ape =o x nts ‘Type 1 for Term Deposit ‘Type 2 for Recurring Deposit Enter your choice: 1 Enter Principal: 19000 Enter Interest Rate: 5 Enter time in years: 3 maturity amount = 119/0.covveeveueNL “Bal eral Window pe =o x ont ‘Type 1 for Term Deposit ‘Type 2 for Recurring Deposit Enter your choice: 2 Enter Monthly Installment: 60 Enter Interest Rate: 10 Enter time in months: 26 Maturity amount = 13050.0 “BB oral insane = 5 x ‘Type 1 for Term Deposit ‘Type 2 for Recurring Deposit Enter your choice: 3 Invalid choice ‘auestion @ Using the binary search technique onthe sorte aay of ntegers given below, ouput the ‘message "Record exists" the value inputs located inthe aay. no, eulput the message "acord dos not ext ‘Sample Input mo) tt] m2) nS} mie] ] 8] nT nie) 1982 1997 1960 1905 1999 2009 2006 2007 2009 2010 Answer Ingore Sevautt. scanners ‘ pic state vis nain(string orst]) ¢ Scmar in = nes Seamercopeten.in)t ne) + (982, 3987, 1952, 1996, 1899, 203, 2006, 2007, 208, 201}: systenoutprint(Enterareeution year to search: “Ds ne june = SnsnetlneOs doe 16, Me nctangen = 3, Lee ts wee Qn) ¢ Seer dem / a SF (ais = 988) Shee (ote) Cyr) Shotenout printin“secrd doesnot ket") ‘syatenout print" eae: Enter graduation year to search: 2003 Record exists Enter graduation year to search: 2019 Record does not exist © Solved 2015 Question Paper ICSE... Solved 2013 Question Paper ICSE. >

You might also like