Professional Documents
Culture Documents
CS2209
CS2209
e"#er :III
To learn the concepts of Object oriented programming and to write programs using C++, Se""%on No 1 E-erc%"e No 1 E-erc%"e" a) Income Tax Calculation using default arguments. b) Categorizing Emplo ees using static members c) !ddition of two pri"ate members using friend function /r%end )unc#%on and /r%end C.a"" % %
&esign matrix and "ector classes with static allocation' and a friend function to do matrix("ector multiplication
1#$m
O0era#or o$er.oad%n' ) )
Implement complex number class with necessar operator o"erloadings and t pe con"ersions such as integer to complex' double to complex' complex to double etc.
1#$m
1#$m
1#$m
-'.'/
2'1$
1#$m
LAB PLAN Sub code:CS2209-OBJECT ORIENTEDPROGRAMMING LAB Branc : CSE Se!e"#er :III
Se""%on No
E-erc%"e No In er%#ance
E-erc%"e"
&efine 3oint class and an !rc class. &efine a ,raph class' which represents graph as a collection of 3oint objects and !rc objects. 4rite a method to find a minimum cost spanning tree in a graph. D1na!%c 0o.1!or0 %"! and RTTI &e"elop with suitable hierarch ' classes for 3oint' 5hape' 6ectangle' 51uare' Circle' Ellipse' Triangle' 3ol gon' etc. &esign a simple test application to demonstrate d namic pol morphism and 6TTI.
11
1#$m
1%
/%.e"
4rite a C77 program that randoml generates complex numbers 8use pre"iousl designed Complex class) and writes them two per line in a file along with an operator 87' (' 9' or :). The numbers are written to file in the format 8a 7 ib). 4rite another program to read one line at a time from this file' perform the corresponding operation on the two complex numbers read' and write the result to another file 8one per line).
1#$m
1)
1*
Mode. E-a!%na#%on
1#$m
Pre0ared b1 S%'na#ure M",S,Ja1an# %3 Sen%or Lec#urer M",A,Ga1a# r%3 Lec#urer M",G,Pa$a%3 Lec#urer M",M,S,Roo0a4a.a3 Lec#urer 29-0&-2009
A00ro$ed b1
Na!e
Da#e
29-0&-2009