Object Oriented Programming (Lab) Assignment # 2: Instructions
Object Oriented Programming (Lab) Assignment # 2: Instructions
Task 1:
Write a C++ program that uses a class named PlotsRecord. Also attach screen shot of the
output [10]
The class has following member variables
Plot_Number
Block
Society_Name
Owned_By
Task 2:
Declare an array named “Person” with three attributes/data members. Declare an array of size
50. Also call their setter /getters of class. Also define a function named void
showPersonDeatails(), which shows the details of those Persons who are between age 20 to
30 and having male gender.
Note:
- ID, is automatically assigned to newly created object by calling default Constructor
-each data member of class has its own setter and getter
-all getter must be constant member function
Test your program and attach the screen shot of code as well as output with your
assignment.
Task 3:
Write a code to prove that execution of destructor is reverse of execution of constructors. e.g
we declare an array of 5 objects say
Int main()
{
Person q[5];
}
the constructor of t[0] excutes first and destructor of t[0] executes at last.
Test your program and attach the screen shot of code as well as output with your
assignment.