Wednesday, April 15, 2009

LAB TEST OOPS

1. WAP that a class student stores roll no, class test stores marks the 2 subjects and result contains total marks obtained in the test class result inherit details marks from test and roll no through multilevel inheritance.
2. Concatenate 2 strings by overloading + operator
3. WAP to add 2 complex numbers by returning objects
4. WAP to swap private data of 2 classes.
5. Create a base class called shape .Use this class to store two double type values that could be used to compute the area of figures. Derive two specific classes’ triangle & rectangle from the base class shape. Add to the base class a member function get_data () to initialize base class data members and another member function display_area () to compute and display the area of the figure. Make display_area () as a virtual function & redefine this function in the derived class to suit their requirements.
6. To read a value of distance from one object and add with a value in another object using friend function.
7. WAP to implement addition operations on complex numbers using constructor overloading
8. String concatenation using dynamic memory allocation concept.

9. To compute the area of triangle and rectangle using inheritance and virtual function.
10. Design a class from which only one object can be created. If more than one object is created, then the program should terminate.

No comments: