Back close

Course Detail

Course Name Object Oriented Programming
Course Code 25CSA387
Program B. Sc. in Physics, Mathematics & Computer Science (with Minor in Artificial Intelligence and Data Science)
Semester CS Lab
Campus Mysuru

Syllabus

Lab Programs

Basic Programs

  1. Print hello world message.
  2. Create four function calculators for fractions.
  3. Write a program that takes length as input in feet and inches. The program should then convert the lengths in centimeters and meters and display it on screen.
  • Print the largest among three integer numbers.

Constructors

  1. Create a class student to store and print the details of student inside a class.
  2. Display odd and even numbers upto a set limit “n” by defining member functions to display even and odd numbers outside the class.
  3. Define a class to represent a bank account. Include the following member
  • Data Members
    Account No
    Name
    Type
    Balance
  • Member Functions
    Deposit an amount
    Withdraw an amount
    To display name and balance
  1. Execute Program to create a bank account using initial amount of Rs 500 and perform all the operations – deposit, withdraw and balance using default and parameterized constructor. Also create an array of object.

Function & Operator Overloading

  1. Create class average and member functions setvalue() and mean() where setvalue() initializes values of a and b .mean() calculates the mean of two numbers and arguments to function mean() is the object of class average. Display the mean value.
  2. Write an overloaded function to calculate and return the area of a square, a circle, a rectangle. Then call it from the main function
  3. Overload unary minus , ++ ,= = ,and  > .
  4. Overload = and + in a string operation.
  5. Overload binary operator + while adding complex numbers
  6. Overload + operator to concatenate two strings.
  7. Write a program to demonstrate this pointer.

Friend Function

  1. Create a Box class which contains width and height. Using a Friend function print the width of the box object.

Inheritance

  1. Create a class student and include data member roll_number. Derive a class test from student base class to include member function marks(x,y).Create class sports with member function get_score.The class result is derived from base classes test and sports that sums the values of x,y and score.
  2. Create object of derived class and invoke all member functions to illustrate multilevel and multiple inheritance.

Virtual Functions

  1. Implement the concept of Virtual functions
  2. Implement pure virtual function and abstract class.

Exceptions and File handling

  1. Implement the exception.
  2. Program to read details of employees from terminal and display them by creating files.

Objectives and Outcomes

Course Objective:  Identify and practice the object-oriented programming concepts and techniques, practice the use of C++ classes, constructor, inheritance, friend functions and file I/O stream concepts. 

Course Outcome:

  1. Implement Object Oriented Programming basic concepts in C++.

2.Creating simple programs using classes and objects in C++.

  1. Implement the constructors and inheritance in C++.
  2. Understanding Friend functions, Function & Operator Overloading, Virtual functions.
  3. Implement Object Oriented Programs using exceptional handling concepts

CO-PO Mapping

  PO1 PO2 PO3 PO4 PO5 PO6 P07 P08 P09 P10 PSO1 PSO2 PSO3 PSO4
CO 1 3 1 1 1
CO 2 1 2 1 1 1
CO 3 2 1 2
CO 4 2 1 1 2
CO 5 2 1 1 1 3

Text Books / References

TEXTBOOKS:

A.E.Balaguruswamy, “Object Oriented Programming with C++”, Fourth Edition, Tata McGraw-Hill, 2008.

B.Herbert Schildt,“The Complete reference C++ “,Fourth Edition,Tata McGraw Hill,2003.

DISCLAIMER: The appearance of external links on this web site does not constitute endorsement by the School of Biotechnology/Amrita Vishwa Vidyapeetham or the information, products or services contained therein. For other than authorized activities, the Amrita Vishwa Vidyapeetham does not exercise any editorial control over the information you may find at these locations. These links are provided consistent with the stated purpose of this web site.

Admissions Apply Now