You are on page 1of 5
Cau héi 1 Conus oe nam ca 100 vr Coch Cau hoi 2 ‘chua cuge ra ‘ond bm cia 1100 cb etundt Pest selec he APPROPRIATE stab ETMpefring clas Store? hon mathoge atom Ca. double rout te achiever ofa student 2b. doxble average te average othe reaut of al stiderts Ce double gpa: students rade pont average 2.4. double pass Tress a stant i pass hier esis hero equi value ‘Given the following code in Python: lush det ott: Pei" 2) ass NO, pas ass 0: det toot: pam") What s the printed result of the following code? a0 xf00(8) Cau tr Iai sy ‘Gwen the folowing declaratons in a staictype checking object rented programming language: lass A {det f000 = pint") lass B extends verde de foo) = pent”) Bis a subclass. ofA ass C extends B { overide de foo) = print"e")}/ Cis. asuncass of 8 ‘dass D extends A ( overide det 00 = pono) isa suncass ofA ‘Assume that variable bis declared in type B and is assigned to some object. what value canbe printed by the call bfo0()? ‘Chon mét hoc nti hon ap Oce Oaa Cau hd; Given that class A SB UBBFESEBGFss 8 and cass C whichis the superclass of cass D. Varables abe 4 and dare declared in ype A,B, C, and D, respectively Conmeveces That means they re declared as fotows “ dass A orb cia 10 dass B extends A yoocdunt dass Cextends A dass D extends © AaBbCa dd, Select the conect choice? ‘Chon mat hoe nhiu hor Da. a=new80 0 e=news9 re) C4 e=newoo Cau hoi 5 cova oncers & nde be cia cohort u hdi onsarveet Which ed is private? class A: def_int_(settabe) sel set_b=b sot_ere Chon mat: Oa King cfd ndo ta prvate Oba Oc » Od _e Given the folowing code in Python: class Num: ef _it_(setx) set class Aas ef _sdd_{settotner return sex + otherx class Mut ef _mul_{setf the return sex" otherx class Nu ease cls Nu pase x= Nut y=Numa() Tho gian eBn a 0.1328 Flin the blanks such that expressions x + y and y "x are vali lex" y and y +x ae invaid Make sure that no space is inthe banks, Cau hoi cnvacuocea nde om ca $00 Vv cbchunt Cau héi 8 cue crocs & nde le cia 100 cochunt {Gwen the folowing code in Python: ent aes 2) eR me e528) Bee ea ‘What is printed bythe following code? x= 88) xfoo(3) Tar ‘Gwen that class Ais the super cass of ats B and C and variables a, band care declared in ype A, 8 and C, respectively, na statictype checking obec rented programing language as flows as By, ce, ‘Select the WRONG or UNNECESSARY (thélg cdn tht casting inthe folowing statements? Cau hoi conse ac cain cia vr co ctuns Cau hi 10 covacuoe td cod aim cde coca Given the folowing Python code: dass A: etry pen ‘class B(A): dete) spt nt") densa tel: nowt +1) ‘lass DAY. & dere see et") co{ om - reat Yous s5e (075 Fae spwcens Ente tink hte erent) ore eo ea 8) How to declare an abstract class in Python? Chon met Oa dessa: © b. abstract class A © € tom abe impor ABC O46 tata

You might also like