Back

README

DSC-04: Object Oriented Programming with C++ - Practicals

Course

Welcome to the collection of practical assignments for the Object Oriented Programming with C++ course. This repository contains implementations for various C++ programming concepts.


📅 List of Practical

  1. Write a program to compute the sum of the first n terms of the following series:
  2. 𝑆=1−\frac{1}{2^2}+\frac{1}{3^3}- .....\frac{1}{𝑛^𝑛}

The number of terms n is to be taken from the user through the command line. If the command line argument is not found then prompt the user to enter the value of n.

  1. Write a program to remove the duplicates from an array.
  2. Write a program that prints a table indicating the number of occurrences of each alphabet in the text entered as command line arguments.
  3. Write a menu driven program to perform string manipulation (without using inbuilt string functions):

1) Show address of each character in string

2) Concatenate two strings.

3) Compare two strings

4) Calculate length of the string (use pointers)

5) Convert all lowercase characters to uppercase

6) Reverse the string

7) Insert a string in another string at a user specified position

  1. Write a program to merge two ordered arrays to get a single ordered array.
  2. Write a program to search a given element in a set of N numbers using Binary Search

1) with recursion

2) without recursion.

  1. Write a program to calculate GCD of two numbers

1) with recursion

2) without recursion.

  1. Create a Matrix class. Write a menu-driven program to perform following Matrix operations (exceptions should be thrown by the functions if matrices passed to them are incompatible and handled by the main() function):

1) Sum

2) Product

3) Transpose

  1. Define a class Person having name as a data member. Inherit two classes Student and Employee from Person. Student has additional attributes as course, marks and year and Employee has department and salary. Write display() method in all the three classes to display the corresponding attributes. Provide the necessary methods to show runtime polymorphism.
  2. Create a Triangle class. Add exception handling statements to ensure the following conditions: all sides are greater than 0 and sum of any two sides is greater than the third side. The class should also have overloaded functions for calculating the area of a right angled triangle as well as using Heron's formula to calculate the area of any type of triangle.
  3. Create a class Student containing fields for Roll No., Name, Class, Year and Total Marks. Write a program to store 5 objects of Student class in a file. Retrieve these records from the file and display them.
  4. Copy the contents of one text file to another file, after removing all whitespaces.

<p align="right">

<i>Developed with ❤️ by <a href="https://github.com/16ratneshkumar">16ratneshkumar</a></i>

</p>