Sei sulla pagina 1di 8
(INTE | International College Subang. FINAL Examination Paper (COVERPAGP) session 5 Angust 2013 Programme Diplms In infomation and Communications Technolog NCTNID couse + ICR2I00:CSC2100 : Object-Oriented Programming De of Examination + _Devember 9, 2013 (Monday Time + $00 m= 10:00am Reading Time: i Duration Hows Special Instructions “Ths paper consists of SIX 6) questions. Answer any FOUR (4 questions inthe answer booklet provided. Materials permitied Non: Programmable Calculator Materials provided Ni Examiner (3) Ms Ng Ruoh Ling, Koo Lee Chun Moderstor De Ang Tan Fong ‘This paver consists of8 printed pages, inti the cover page. ACPENON /ESC2100 (P) Page tof 7 IYTHINTERNASIONAL COLLEGE SUBANG DIPLOMA IN’ COMPUTING AND INFORMATION TECHNOLOGY PROGRAMME, (DICTNIDICT, ICT2100 / €$C2100 : OBJECT-ORIENTED PROGRAMMING FINAL EXAMINATION: AUGUST 2013 SESSION nstruetions: This paper cosiss of SIX (6) questions. Answer any FOUR (4) questions in the ui @ ® swe booklet provided. Al questions cary equal marks restion 1 “Assuming ll variables used are declared and intazed, identity the aya errs in the following statements. Write the comect statement for each, @ Ane a2, double B25; @ Gi) af oeniyrts else itt (i) it(zexees) System. cut printIn (ct is between 2 and 5°}; (tftp cia ana a > 10) system.cat arintin(pé" is smaller than "a)s (i) x10: yoxe20: (12 marks) “Trace the oupat of ths Following program fragment double e-$; int ae20, bed5; Beat b ih System.out-printin ("a :* + als brat a e-= abi > Syatem.out.println en bi +2; System.out printin systen.out .prantia aia tie tbe System.out.printin (masks) ACT IO0/ CSC209 (F) /Page Zo? output oF the following program: public clase gle | public static void maan{Serang(l acge) { ine p93, white (el) i erties: Systam.out-peintia (ph: , , , (Tmaris) Question? (@) What is method overlong? @ marks) (©) Demonstate method overloading by providing three methods all named bigger. The © @ © ‘rt one takes three integers and returns whichever is bigger. The second method takes ‘wo characters and fetus whichever character is bigger. The thed method fakes two ‘sings and retums whichever sting is bigger (@rmaits) ‘What is recursive method? (mars) ‘Wite a secursive method named range shat takes ‘wo integers: tin and max, and print all the integers betweon asin and max. For example, if min #2 and max is 7, the ‘methed wil rit te following as out: mst) entify the FIVE (5) methods used in Java Applet program eyele, (Smuts)

Potrebbero piacerti anche