OOPs with C ++ Programming

Teacher

A Avinash

Category

Core Courses

Course Attendees

Still no participant

Course Reviews

Still no reviews

Course Name : OOPs with C ++ Programming

Code(Credit) : CUTM1879 (2-3-1)

Course Objectives

  • To understand how C++ improves C with object-oriented features
  • To learn how to design C++ classes for code reuse
  •  To learn how inheritance and virtual functions implement dynamic binding with polymorphism
  • To learn how to use exception handling in C++ programs

Learning Outcomes

  • Apply the object-oriented programming approach in connection with C++
  •  Illustrate the process of data file manipulations using C++
  • Apply virtual and pure virtual functions & complex programming

Course Syllabus

Module I: Revision of C programming (8 hrs)

Revision of C Programming, Pointers, Functions (Call by value and reference), Recursion, Arrays using Pointers, Structures, Union, Enumeration and Typedef, File handling.

Programs:

  1. Write a Program to perform Parameter passing.
  2. Write a program to create a scientific calculator.
  3. Write a program to convert a decimal to binary number using recursion.
  4. Write a program to Read 'n' employee details and display the top 10 employees as per their salary.
  5. Write a program to evaluate MCQ questions of an examination and generate the results using files.

Module II: Basics of Object oriented concepts (8 hrs)

Object-oriented concepts Classes and Objects, Encapsulation, Abstraction, Overloading, Inheritance, and Polymorphism. Beginning with C++, Tokens, Static Members, Constant Members, Expressions, Control Structure, Functions: parameter passing, inline function, and function overloading.

Programs:

Write a program to read a number and check whether the number is Prime number , Palindrome number , Magic number , Armstrong number , Strong number or not.

Write definitions for two versions of an overloaded function. This function‟s 1st version sum() takes an argument, int array, and returns the sum of all the elements of the passed array. The 2nd version of sum() takes two arguments, an int array and a character („E‟ or „O‟). If the passed character is „E‟, it returns the sum of even elements of the passed array and is the passed character is „O‟, it returns the sum of odd elements. In case of any other character, it returns 0 (zero).

Module III: Class-Object-Constructor (10 hrs)

Classes: data members, member function, array of objects, static data members, constant members function, and friend function. Constructors, Encapsulating into an object, Destructors.

Programs:

  1. Define a class to represent a book in a library. Include the following members:
    Data Members Book Number, Book Name, Author, Publisher, Price, No. of copies issued, No. of copies
    Member Functions (i) To assign initial values (ii) To issue a book after checking for its availability (iii) To return a book (iv) To display book information.
  2. A bank maintains two kinds of accounts for customers, one called as savings and the other as current account. The savings account provides compound interest and withdrawal facilities but no cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level a service charge is imposed.
    Define a class to represent a bank account. Include the following members: Data members: 1. Name of the depositor. 2. Account number. 3. Type of account. 4. Balance amount in the account. Member functions: 1. To assign initial values. 2. To deposit an amount. 3. To withdraw an amount after checking the balance. 4. To display the name and balance. Write a main program to test the program
  3. Declare a class to represent fixed-deposit account of 10 customers with the following
    data members: Name of the depositor, Account Number, Time Period (1 or 3 or 5 years), Amount. The class also contains following
    member functions: (a) To initialize data members. (b) For withdrawal of money (after alf of the time period has passed). (c) To display the data members.
  4. Create two classes DM and DB which store the value of distances. DM stores distances in meters and centimetres and DB in feet and inches. Write a program that can read values for the class objects and add one object of DM with another object of DB. Use a friend function to carry out the addition operation. The object that stores the results may be a DM object or DB object, depending on the units in which the results are required. The display should be in the format of feet and inches or meters and centimetres depending on the object on display.

Module IV: Inheritance (8 hrs)

Associations, Inner Classes, Memory Management and pointers

Inheritance: Derived classes, member accessibility, forms of inheritance, virtual base classes.

Programs:

  1. Write a Program to describe about all types of inheritance.
  2. 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 called triangle and rectangle from the base 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 figures. Make display_area() as a virtual function and redefine this function in the derived classes to suit their requirements. Using these three classes, design a program that will accept dimensions of a triangle or a rectangle interactively, and display the area
  3. An educational institution wishes to maintain a database of its employees. The database is divided into a number of classes whose hierarchical relationships are shown in following figure. The figure also shows the minimum information required for each class. Specify all classes and define functions to create the database and retrieve individual information as and when required.

Module V: Polymorphism (8 hrs)

Polymorphism (Compile time Polymorphism, Run time Polymorphism), Virtual Functions, Abstract class, virtual destructors, Interfaces.

Programs:

  1. Write a Program to overload ++ operator.
  2. Write a program to overload + operator by concatenating strings.
  3. Write a program to describe about virtual function.

Module VI: Exception Handling (8 hrs)

Exception Handling, Managing Console I/O Operations, Streams & Files: streams, hierarchy of stream classes, working with files

Programs:

  1. Write a Program to describe about exception handling mechanism.
  2. Write a Program to describe multi catch statement.
  3. Write a program to read a list containing item name, item code, and cost interactively and produce a three column output as shown below.
  4. Write a program that reads a text file and creates another file that is identical except that every sequence of consecutive blank spaces is replaced by a single space.
  5. Write a program that reads character from the keyboard one by one. All lower case characters get store inside the file LOWER, all upper case characters get stored inside the file UPPER and all other characters get stored inside OTHERS.

Module VII: Templates (8 hrs)

Advance Topics in C++ Object Design and Templates STL (Standard Type Libraries)RTTI (Run Time Type Identification) Advanced Typecasting ,new data types, new operators, class implementation, namespace scope , operator keywords, new headers , C++ Containers

Programs:

  1. Write a function template for finding the minimum value contained in an array.
  2. Imagine a publishing company that markets both books and audio-cassette versions of its works. Create a class called Publication that stores the title (a string) and price of a publication. From this class derive two classes: Book, which adds a page count (type int); and Tape, which adds a playing time in minutes (type float). Each of the three class should have a getdata() function to get its data from the user at the keyboard, and a putdata() function to display the data.
    Write a main() program that creates an array of pointers to Publication. In a loop, ask the user for data about a particular book or Tape, and use new to create a object of type Book or Tape to hold the data. Put the pointer to the object in the data for all books and tapes, display the resulting data for all the books and taps entered, using a for loop and a single statement such as pubarr[i]->putdata();to display the data from each object in the array.

Text Books:

  1. E Balagurusamy, “Object Oriented Programming with C++”, Tata McGraw Hill, Sixth Edition.
  2. Herbert Schlitz, “The Compete Reference C++”, Tata McGraw Hill, Fourth Edition.

Session Plan

Session 1

I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Session 2

I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Case Studies

Case Studies

Our Main Teachers

A Avinash

Asst Professor
VIEW PROFILE

A.Avinash working as Assistant Professor, Dept of CSE, Centurion University of Technology and Management, Andhra Pradesh . Interested to work on Machine learning,Natural Language Processing,Problem Solving Methodologies , and ChatBot. Programming Skill: C Programming Data Structure Object Oriented Programming using C++ Formal Language Automata Theory Python Web Development(HTML,CSS,PHP) Database Management Systems Compilers