Practical List OOPM Jul-Dec 2021

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Acropolis Institute of Technology and Research, Indore

Department of Information Technology

LAB MANUAL FOR OBJECT ORIENTED PROGRAMMING & METHODOLOGY (IT – 304)

List of experiments other than RGPV list:

1. WAP to create a class Employee with setter getter methods for accepting and showing his/her
organizational and personal details.

2. WAP to implement inline function which prints maximum of two numbers.

3. Write a Program to design a class having static member function named showcount() which has the
property of displaying the number of objects created of the class.

4. WAP to implement single inheritance to get two numbers in base class and add them in its derived
class.

5. Create a class ‘Vehicle’ and ‘Fourwheeler“ and derive a class ‘Car’ form both the base classes.
Compute multiple inheritance to inherit all the properties of ‘Car’ and ‘Fourwheeler’.

6. Consider a class ‘Vehicle’ which has a derive class ‘Fourwheeler’ and ‘Fourwheeler’ also has a derived
class ‘Car’. Class ‘Vehicle’ has data members category(string) and reg_no(int). ‘Fourwheeler’ has data
members model_no, isuue_year, and company. Compute the program to print their properties
using multilevel inheritance.

7. Consider two classes ‘Vehicle’ and ‘Fare’ in which ‘Vehicle’ has a derived class ‘Car’ and a class ‘Bus’
which is derived from both the classes ‘Vehicle’ and ‘Fare’. Compute the hybrid inheritance and print
Fare of Car and Bus.

8. Consider a class ‘Vehicle’ which has two derived classes ‘Fourwheeler’ and ‘Twowheeler’. Class
‘Vehicle’ has data members category(string) and reg_no(int) and derived classes has model_no, color,
company_name. Compute the program to print their properties using hierarchical inheritance.

9. Write a Program illustrating how the constructors are implemented and the order in which they are
called when the classes are inherited. Use three classes named Alpha, Beta, Gamma such that Alpha
and Beta are base classes and Gamma is derived class inheriting Alpha and Beta.

10. WAP to implement parameterized constructor which takes two arguments x and y and display the
values of x and y variables by calling member functions getx() and gety().
11. WAP to implement constructor ‘power()’ with default argument ’n=9’, ‘p=3’ and define this outside
the class and call the function print() which displays ‘n power p’.

12. Create a class IT and also create a parameterized constructor IT(int t) and a copy constructor IT(IT
&m) and compute a program to copy data of one object to another object.

13. WAP to implement virtual function using a base class A & derived class B and also create two
member functions show(), display() which will display the name of class and override them in derived
class making show as virtual function.

14. Create a class called dimension containing three float data and a constructor to accept values. Also
declare a pure virtual function area ( ) in it. Create three derived classes Rectangle, Square and
Triangle each inheriting dimension as public. Define corresponding constructors and redefine virtual
function area in each. Write a complete program and also print the version of virtual function used
each time area is printed.

15. WAP to implement swapping of data using call by value.

16. WAP to implement swapping of data using call by reference.

17. Write a Program to swap private data members of classes named as Class_1, Class_2 using friend
function.

18. Write a program to accept the student detail such as name and 3 different marks by get_data()
method and display the name and average of marks using display() method. Define a friend class for
calculating the average of marks using the method mark_avg().

19. WAP to implement function overloading by overloading the print function which prints an int, char
and double type.

20. WAP to overload unary operator ‘–‘ by creating operator function which takes a number as an input
and prints the negative of that number.

21. Write a program to perform addition of two variables ‘feet’ and ‘inch’ using constructor overloading.
The first constructor which takes no argument is used to create objects which are not initialized,
second which takes one argument is used to initialize real and imag parts to equal values and third
which takes two argument is used to initialized real and imag to two different values.

22. WAP to create a base class box which accepts its length, breadth and height. Overload + operator
which adds 2 objects in a new object and find the volume of the new object.

23. WAP to add two objects of a class distance in its 3rd object using operator overloading.

24. WAP to concatenate two strings using operator overloading.


List of Experiments as per RGPV Syllabus:

1. Write a program to find out the largest number using function.

2. Write a program to find the area of circle, rectangle and triangle using function overloading.

3. Write a program to implement complex numbers using operator overloading and type conversion.

4. Write a program using class and object to print bio-data of the students.

5. Write a program which defines a class with constructor and destructor which will count number of
object Created and destroyed.

6. Write a program to implement single and multiple inheritances taking student as the sample base
class.

7. Write a program to add two private data members using friend function.

8. Write a program using dynamic memory allocation to perform 2x2 matrix addition and subtraction.

9. Write a program to create a stack using virtual function.

10. Write a program that store five student records in a file.

11. Write a program to get IP address of the system.

12. Write a program to shutdown the system on windows operating system.

You might also like