0% found this document useful (0 votes)
3 views11 pages

OOPS Assignment 2

assignment based on oops

Uploaded by

rajan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
3 views11 pages

OOPS Assignment 2

assignment based on oops

Uploaded by

rajan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
vord Ub Tipo Ord Coub* name < addsen Kendle ; COut+*< B0C << balance 3 is vold add Cint x) § balance += x ; 5 void withdraw Cink x) € it, Coalance == 9 tl x > balance) & cout << “account is eably’; as ¢ jold Inbut Info) § Gin»> soll ; Cin > name 5 ‘ Cin Sub 1> sub2 > sub 3 E a Voio! Cle Pescentage C) Pee= Coubty supe + subs) /3; it Ches>= 40) & coubec Aus hei Chew >= 80) & cout = 60) & cout a", |; che it Ches>=40) & cous + "D533 che Fcoutx< "6" 53 iy void DishlayTigo () € Cout~ pame } cone soll 5 Cout << sub{ x Sub2 << Sub3 5 gq cars , These may be many Crs wot. die ¢ bue all Q Pham will hace kane commen brober tes Sheed (imal , mileage , sarge che Aw objec fs an instance acl» hen a chm js defined , peo omy ts allocated but When itis indtantitted Ciece an oGjech is c seated) memory is allocated examble -— Ht inchede ~< bits /sfd Crh > Using name Space std j Public 3 String model 5 void bring () E Cout "the name cf the car (s"¢¢ podel ; Clam, Cov © main 0 € known ad oe Di f r docry -¢ fave a setusn Value hence no sebunnr LSyhe, Syntax & Csr ih bovametes) € O cstaon efistion Tyhe Gustructorr Dyjutt —— a... » Parameterized te Default Coustsuckor Default av, doom t Lake a Called 04 2-4 » Coby wliuclor is ths cankbruclor een LY gure» Tt has ho Favameters, Tee abheo Tyument Cont suclor 2. Paxamebertocd Cont ucty * T& Passible to bay Or gumenty bo Cnstouctors. 40 Shy Combsuct- £2king haxamebers /s called 4 4 barameteatzed aonxtxachor Je toald ko any (rete Contéruclor ¢ A toby Comteucter Lhat inchialises an Weng Another object | he Eame Clays, Cof, (9 ont Such OA xelesence t an object Of the same clams gy an aczy bublic ¢ ft avea 3 float Ferimetes 5 gum () é area =O j Pesimeter = 0 5 sum Cit poral, int 6) 6 aven= «6; Pesimetes = 2« (416); 5 void dishOoe - Cout << Orcas bevimelor y 1 bans = falre 5 5 Student Ct masks, Garry name , bool bars )E Ess > masks = masks; this > hame = nan 5 Parameterised Coutrucko- Meek. ken, 3 studi C student © obj) € marks = ae Bera) Coby couksuck AOU Obj. rane 5 Pas = obj» Pars j a w studert > § lout 44 "dertouctor executed" ; a Dertonus Comblex C tit x, nt 7) € veal 2%; image is} Cowblex obesabor + CComblex Coat b Obj) 8 Conblex ser 5 Teal = seal + 06}. veal j Bes. drag = jmag+ ob. imag Vebum vey 5 gf es There ase 6 tyke qe oe racks in Crt j - to Avighmelto obewtrs (+,-, +, 7, yy Pe Relakienad oberectors (>, < ,(- [a5 <= = Ss logicat oberahos COL, I) & 4s Bitwite theaters (Y, 1) 5. hevignnert obewekrs C=.4-,-= y= 7d Teshany oheraers Ne Comblex Oberator + Clomblex b obj) F Comber ves 4 BA. veal = weal + of}. weal ; VS. imag = imag + obj, imag j selum ses 5 Ei Comblox dhesater ¢— Coomblox & obj) ¥ Comb lex res 5 Bey -wead = veal - obj, seal j Bes rimay = imag - 0ty.br9y ; petum vey 5 Td point 09 E void obesaker ++ (>) § if (vin == 54) § min = 0 j hove 4+ 5 che inte 5 J void bint (> 8 Coukt< Lhe time 6 "4 hous << "3 "ee min 5 a i) uk main 0) & . < COiscle & 06) & L (axeq >-0bj. asea) & fete " asco G fist objeck is qseabes " 5 che & Cut « " gaea A scamd object ic greater” ; ) a void Point C) & touk 44 area 5 b Se bk main) 6 Ciscle 01 (7)} cole 02( 9); Or<02 4 sehum 05 ae Comblex obesador + (Conblex bj) & Comblex yes ; GA. weal = Beal + Obj. veal ; va. roa = tnay + 0bj- Tmmag j Tetum se 5 j Comblex shevadtior - CComblo obj) & Complex ved 5 wey. veal = wtol - obj. seal» es imag = Unay - obj. imag j aa void obttatrr == (Camblex b obj) oi Cyead = - obj. seal LG bnag = = obj imag) fo Bout

You might also like