List of Experiments CPP

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

VNR VIGNANA JYOTHI INSTITUTE OF ENGINEERING AND TECHNOLOGY

(AUTONOMOUS)
B.Tech. II Year I Semester
OBJECT ORIENTED PROGRAMMING THROUGH C++

List of Lab Experiments

Week 1:

1. C++ Program to Print "Hello, World!".


2. C++ Program to display contents of variables of different data types.
3. C++ program to take various data input from user and display it.
4. C++ Program to Add Two Integers.
5. C++ Program to Swap Values of Two Variables.
6. C++ Program to multiply two Floating Point Numbers.
7. C++ Program to perform all arithmetic operations using switch case.
8. C++ Program to convert celcius to farenheit.
9. C++ Program to convert farenheit to celcius.
10. C++ Program to find the Size of data types.
11. C++ Program to Print ASCII Value.
12. Write a program in C++ to print the following pattern.
xxxxx
x xxx
x xx
x xxxxxxxxxxxxxx
x xx
x xxx
xxxxx
13.
14. C++ Program to convert days to years, weeks and days.
15. C++Program to calculate Simple interest by taking inputs from user.
16. C++Program for global variables.
17. C++ Program to create a class and its members(data and functions) and access it
through object.

Week 2:

1. C++ Program to Calculate Area of Circle using function.


2. C++ Program to Calculate Area of Square using function.
3. C++ Program to Calculate Area of Rectangle using function.
4. C++ Program to swap two numbers using call by value, call by reference and call by
pointers.
5. C++ Program to demonstrate the use of inline function.
6. C++ Program to print first N natural numbers using inline function.
7. C++ Program to create inline function to return max of two numbers.
8. C++ Program to illustrate the static member function.
9. C++ Program to Count the number of objects using Static member function.
10. C++ Program to demonstrate public access specifier.
11. C++ Program to demonstrate private access specifier.
12. C++ Program to demonstrate protected access specifier.

Week 3:

1. C++ Program to demonstrate working of default argument using function.


2. C++ program to demonstrate example of default constructor or no argument
constructor.
3. C++ program to demonstrate example of destructors.
4. C++ program to implement stack operations where initialization is done using
constructor.
5. C++ program to demonstrate example of parameterized constructor.
6. C++ program to demonstrate an example of constructor with one argument.
7. C++ program to demonstrate example of copy constructor to copy data of an object to
another.
8. C++ program to show the differentiation between shallow and deep copy in copy
constructor.
9. C++ program to demonstrate example of constructor overloading. (Employee record)
10. C++ program to demonstrate constructors with dynamic operations.
11. C++ program to demonstrate example of constructor with default arguments.

Week 4:

1. C++ program to illustrate dynamic allocation and deallocation of memory using new
and delete.
2. C++ program to illustrate dynamic allocation and deallocation of memory using
constructor and destructor.
3. C++ program to demonstrate passing of objects to functions using:
i. Call-by-value
ii. Call-by-reference
iii. Call-by-pointers
4. C++ program to create a function that returns an object.
5. C++ program to create an array of Student objects and display the data for each
student.
6. With the help of Pointer to objects show operations on Array of objects.
7. C++ program to implement Array of pointers to objects.
8. C++ program to demonstrate example of constructor using “this” pointer.
9. C++ Program to show dynamically resizing of an array(
i. Create an entirely new array of the appropriate type and of the new size.
ii. Copy the data from the old array into the new array .
iii. Delete the old array.
iv. Change the pointer. )
10. C++ Program to demonstrate working of friend function with class.
11. C++ Program for Addition of members of two different classes using friend Function.
12. C++ program to demonstrate friend Class.

Week 5:

1. C++ Program to demonstrate Function overloading for printing different type of


values.
2. C++ Program to overload the function sum for different types of arguments.
3. C++ Program to create an Area class and overload the function cal_area for
calculating area of circle, rectangle.
4. C++ Program to compute absolute valuefor integer and float using function
overloading.
5. C++ Program to demonstrate binary operator (+,-,*,/) overloading using member
function.
6. C++ Program to demonstrate unary operator (++,--,-) overloading using member
function.
7. C++ Program for overloading operator++ and operator -- using friend functions.

Week 6:

1. C++ Program to concatenate two strings using Operator Overloading.


2. C++ Program to compare two strings using Operator Overloading.
3. C++ Program to overload arithmetic assignment operators.
4. C++ Program to overload new and delete operators.
5. C++ program to create a template function (for max() and min)that works for all data
types.
6. C++ program to do template based overloading for display function.
7. C++ Program to implement Bubble Sort using templates.
8. C++ Program to demonstrate template class .
9. Program to demonstrate working of non-type parameters to templates in C++.

Week 7:

1. C++ program to demonstrate implementation of Inheritance.


2. C++ Implementation to show that a derived class doesn’t inherit access to private data
members. However, it does inherit a full parent object.
3. C++ program to explain Single inheritance .
4. C++ program to explain multiple inheritance.
5. C++ program to implement Multilevel Inheritance.
6. C++ program to implement Hierarchical Inheritance.
7. C++ program for Hybrid Inheritance.

Week 8:

1. C++ Program to demonstrate Compile time polymorphism.


2. C++ Program to show Ambiguity in Member Access.
3. C++ Program to demonstrate how to handle Ambiguity in member access.
4. C++ program to show the need of Virtual Functions.
5. C++ Program to show implementation of Virtual Function in Derived class.
6. C++ Program to demonstrate Run time polymorphism using virtual keyword.
7. C++ Program to demonstrate Pure Virtual Functions.
8. C++ Program to demonstrate Abstract Class.
9. C++ Program to demonstrate Virtual Destructors.

Week 9:

1. Write a simple example to show exception handling in C++.


2. C++ Program which throws a division by zero exception and catch it in catch block.
3. C++ Program to show implementation of own exception class.
4. C++ Program to implement nested try catch block using throw.
5. C++ program that contains multiple catch blocks to handle different types of
exception in different way.
6. C++ to demonstrate exception in constructor and destructors.
7. C++ program to demonstrate catch all .
8. C++ program to throw an exception from a function outside the try block.
9. C++ Program to demonstrate list of exceptions in a Function. And its restriction.
10. C++ program to implement set_terminate() and set_unexpected() methods.

Week 10:

1. C++ Program to Implement Vector in STL.


2. C++ Program to Implement Stack in Stl.
3. C++ Program to Implement Set in Stl.
4. C++ Program to Implement Queue in Stl.
5. C++ Program to implement Map in Stl.

Week 11:

1. C++ program to create a file.


2. C++ program to read a text file.
3. C++ program to write and read text in/from file.
4. C++ program to write and read values using variables in/from file.
5. C++ program to write and read object using read and write function.

Week 12:

1. C++ program to demonstrate example of tellg() and tellp() function.


2. C++ program to demonstrate example of seekg() and seek() function.
3. C++ program to write and read time in/from binary file using fstream.
4. C++ program to write and read an object in/from a binary file.

You might also like