Oo
PS LAB (CEN-492)
Deptt. of Computer Engg.
reate a class for counting the number of re arious block
ng constructor and destructors,
1 as roll_no & name. Create a member function set_d
print() member function to print which object has
Write a C++ program to implement virtual funet
polygon which has virtual function area(). Two classes
from ¢ polygon and they have area() to calculate and retur
7. Wri
a C+ pr
gram to count the number of persons inside @ bank, by increasing count
son enters a bank, using an increment (++) operator overloading function, and
g a decrement (--) operator
decrease the count whenever a person leaves the bank usi
ding function inside a class.
8, Write 4 C++ program to create two objects of a cl
s called company and add their dats
‘operator and ‘operator
members using an operator overloaded function for
class matrix,
9. Write a program in C++ to crea
addition and subtraction.
id overload +, - operator to perform matrixaccept five different numb mn
i rege aici i 1
W Deram to accept dent detail such as name and 3 differe b
ssi di hod and disp me and average of marks using displ Define
te a program that uses a function template called min to 4 ‘ of two
The program should work for inte ara
uments to this function.
rogram to explain class template by creating temp) s named pair
ha sbers of type T which are inputted by a constructor and a member
in get-max() retum the greatest of two n to main. Note
blo spon th yf fied during object creation
w hhich contains student detail
{student st
Cin>> st
Writ D which inherits another class 2D, for 3 dimensional calculations. Usi
any 2 points in a 3D space and find the distance between them. The formula for
ec finding the distance between any 2 pts in 3D sp
ti Distance = SquareRoot (xd*xd + yd*yd + zd*zd)
seman Where d=x2-x'
yd 1
dm 22-21
6:Write a program in java to implement a calculator having. addition and subtraction operations
along, with the concept of memory (M+) i re the current value on the screen for later
17.Weite a program bt C++ that acts as a Contact Manager. I
jes the content to a file &
ced by the user. Modules of the program include: Add, Delete, Seat