MCA304/ MCS104: OBJECT ORIENTED PROGRAMMING

Odd Semesters (updated July 2006)

General Course Information:  

Course Credits     : 07 (Theory – 04 + Laboratory – 03)

Classes                  : Theory - 04 and Laboratory – 06 per week.

Meeting Times     : Theory - Wednesday & Friday 11.10 . – 12.40 hrs.

                                   Laboratory - Wednesday & Friday 13.45 – 16.10  hrs.

Location                :  Theory - CC2, Laboratory – CCML.

Assessment          :  Periodical Tests, Assignments and Semester End Examination.

Course Objectives & Prerequisites:  

The course aims is to introduce the students to Object Oriented Programming Concepts with special emphasis on Object Oriented

Programming in C++. The course begins with a gentle introduction to OOAD and OOP concepts. Students will then be presented

with detailed discussion of Object Oriented Programming features in C++. At the end the use of Wizards and MFCs will be

discussed, followed by few applications of OOAD and OOP concepts in areas like Software Engineering and Operating Systems. 

In order to take the course the student should be familiar with Digital Computer System and must have completed a basic course

in Computer Programming, preferably in C.   

Course Syllabus:  

OOAD and OOP, Object Oriented Programming paradigm and design; General Concepts: Object, Class, Data Abstraction and

Encapsulation, Inheritance, Polymorphism, Dynamic Binding, Message Passing; Benefits of OOP, Object-oriented Languages.  

 

Object oriented Programming using C++: Data Types, Operators, Classes and Objects, Constructors and Destructors,

Operator Overloading, Type Conversions, Inheritance, Pointers, Virtual  Functions, Polymorphism, Stream I/O in C++,

File Processing, Templates, Standard Template Library, Program defined exceptions, Events; Introduction to Class Wizard,

Application Wizard and MFC.  

 

Use of OOAD and OOP concepts in different areas: - Object-oriented Software Engineering, Object-oriented OS.  

Text Book:  

1.     E. Balagurusamy, Object Oriented Programming with C++, 2/ed, TMH.  

Reference Books:  

1.      B. Stroustrup, The C++ Programming Language, Addison-Wesley.

2.      H. Schildt, C++: The Complete Reference, Osborne/McGraw-Hill, 4/e.

3.      Rumbagh et. al., Object Oriented Modeling, PHI.

4.      R.S. Pressman, Software Engineering: A Practitioner’s Approach, Mc Graw Hill.  

Course Calendar:  

                          

Day & Date

Topic

Wednesday 26.07.2006

Introductory Lecture: Software Engineering Concepts, OOAD and OOP, Meaning of Object Orientation, Characterizing Objects.

Friday 28.07.2006

OOP Paradigm & Themes: Features of OOP, Procedure Oriented vs. Object Oriented Programming, OOP Concepts and Themes, Benefits of OOP.

Wednesday 30.08.2006

Introduction to C++: Evolution of C++, Structure of C++ program, Control Structures and Functions in C++, Operators.

Friday 1.09.2006

Classes & Objects: Defining and Instantiating a Class, Attributes and Methods of a Class, Arrays within a Class, Static Members.

Wednesday 6.09.2006

Classes & Objects Contd: Objects as Function Arguments, Friendly Functions, Returning Objects, Pointers to Members, Constant Members.

Friday 8.09.2006

Constructors & Destructors: Default and Explicit Constructors, Parameterized Constructors, Multiple Constructors in a Class, Destructor.

Friday 15.09.2006

Operator Overloading: Overloading through member or Friend function, Rules for Overloading, Operators that can not be Overloaded.

Wednesday 20.09.2006

Type Conversion: Conversion from Basic Type to lass Type, Conversion from lass Type to Basic Type, Conversion from one Class type to another.

Friday 22.09.2006

Inheritance: Reuse through Composition and Inheritance, Derivation, Overriding, Parent Constructors &Destructors, Types of Inheritance.

Friday 14.09.2006

Polymorphism: Pointers to Objects, This Pointer, Pure Virtual Functions.

Wednesday 27.09.2006

Periodical Test 1.

Friday 29.09.2006

Stream I/O: C++ Streams, C++ Stream Classes, Unformatted I/O Operations, Formatted I/O Operations, Manipulators, Designing own Manipulators.

Friday 6.10.2006

Disk I/O: File Stream Classes, Opening and Closing a File, File Modes, File Pointers, Sequential I/O Operations, Errors, Command Line Arguments.

Wednesday 11.10.2006

Templates: Function and Class Templates, Overloading of Template Functions.

Friday 13.10.2006

Standard Template Library: Components of STL, Containers, Algorithms, Iterators, Vectors, Lists, Maps, Common C++ Library Files.

Wednesday 18.10.2006

Exception Handling: Exceptions; Try, Throw and Catch; Multiple Catches, Rethrowing, Specifying Exceptions.

Friday 20.10.2006

Manipulating Strings: C vs. C++ Strings, String Class: Commonly used Constructors, Member Functions and Class Interface for String Class.

Friday 27.10.2006

Advanced Features of C++ and Visual C++.      

Wednesday 1.11.2006

Periodical Test 2.

Friday 3.11.2006

Applications: Object Oriented Software Engineering, Object Oriented Modeling, Notations.

Wednesday 8.11.2006

Applications: Object Oriented Operating Systems, Design Methodology and Features.

Friday 10.11.2006

Applications: Object Oriented and Object Relational Databases, Main Features.

Wednesday 15.11.2006

General Discussion and Review of Previous Year’s Question Papers.

 

Laboratory Assignment 1  

 

(To be submitted latest by 01.11.2006)

 

 1.     Implement and test the following member functions for a string class:

             (a)    int numwords( )  – that returns the number of words in the string.

             (b)    int capitalize( )    -  that capitalizes all the words in the string.

             (c)    void reverse( )     – that reverses the string.

             (d)    int palindrome( )  – that returns 1/0 according to whether the string is palindrome or not.

2.       2.   Write appropriate class definition to create a linked list of items. Write following member functions:

             (a)    void display( ) – that displays the contents of the list.

             (b)    void insert( )   -  that inserts an element at a specified position.

3.      3.    Write appropriate class definition to create a Queue of items. Write following member functions:

             (a)    void insert( )   -  that inserts an element at the rear end of the Queue.

             (b)    void delete( )   -  that deletes an item from the Queue.

4.       4.    Write appropriate class definition to create a weighted Graph. Write appropriate member functions to:

             (a)    return the Breadth First Traversal of the graph.

             (b)    return the Depth First Traversal of the graph.

             (c)    return a minimum cost spanning tree for the graph.

5.       5.  Write Programs to solve the following problems using Backtracking:

 (a) N Queens problem                    (b) Graph Coloring problem

 (c) Sum of Subset problem where,

  No. of subsets n = 6      Sum of Subsets = 30

  Weights (w1, w2, w3, w4, w5, w6) = (5, 10, 12, 13, 15, 18)

 6.  Write a program in C++ to create a Class Matrix whose elements are complex numbers.

      Perform following operations:

       (a)  Overload * operator to multiply two matrices.

       (b)  Overload -- operator to compute complex conjugate of a matrix.

       (c)  Overload ~ operator to compute transpose of a matrix.

       (d)  Overload ++ to check whether a matrix is unitary or not.

       Note: A square matrix A with complex elements is unitary if A’s product with its conjugate transpose

                  ( ~ (--A ) ) is identity matrix.  

 

Laboratory Assignment 2

 

(To be submitted latest by 25.11.2006)  

 

1.   Write a program in C++ to implement a class Stack and use it to check whether a given input string is

      palindrome or not.

 

   

Semester End Examination: First / Second week of December

                          

Day & Date

Topic

Wednesday 26.07.2006

Introductory Lecture: Software Engineering Concepts, OOAD and OOP, Meaning of Object Orientation, Characterizing Objects.

Friday 28.07.2006

OOP Paradigm & Themes: Features of OOP, Procedure Oriented vs. Object Oriented Programming, OOP Concepts and Themes, Benefits of OOP.

Wednesday 30.08.2006

Introduction to C++: Evolution of C++, Structure of C++ program, Control Structures and Functions in C++, Operators.

Friday 1.09.2006

Classes & Objects: Defining and Instantiating a Class, Attributes and Methods of a Class, Arrays within a Class, Static Members.

Wednesday 6.09.2006

Classes & Objects Contd: Objects as Function Arguments, Friendly Functions, Returning Objects, Pointers to Members, Constant Members.

Friday 8.09.2006

Constructors & Destructors: Default and Explicit Constructors, Parameterized Constructors, Multiple Constructors in a Class, Destructor.

Friday 15.09.2006

Operator Overloading: Overloading through member or Friend function, Rules for Overloading, Operators that can not be Overloaded.

Wednesday 20.09.2006

Type Conversion: Conversion from Basic Type to lass Type, Conversion from lass Type to Basic Type, Conversion from one Class type to another.

Friday 22.09.2006

Inheritance: Reuse through Composition and Inheritance, Derivation, Overriding, Parent Constructors &Destructors, Types of Inheritance.

Friday 14.09.2006

Polymorphism: Pointers to Objects, This Pointer, Pure Virtual Functions.

Wednesday 27.09.2006

Periodical Test 1.

Friday 29.09.2006

Stream I/O: C++ Streams, C++ Stream Classes, Unformatted I/O Operations, Formatted I/O Operations, Manipulators, Designing own Manipulators.

Friday 6.10.2006

Disk I/O: File Stream Classes, Opening and Closing a File, File Modes, File Pointers, Sequential I/O Operations, Errors, Command Line Arguments.

Wednesday 11.10.2006

Templates: Function and Class Templates, Overloading of Template Functions.

Friday 13.10.2006

Standard Template Library: Components of STL, Containers, Algorithms, Iterators, Vectors, Lists, Maps, Common C++ Library Files.

Wednesday 18.10.2006

Exception Handling: Exceptions; Try, Throw and Catch; Multiple Catches, Rethrowing, Specifying Exceptions.

Friday 20.10.2006

Manipulating Strings: C vs. C++ Strings, String Class: Commonly used Constructors, Member Functions and Class Interface for String Class.

Friday 27.10.2006

Advanced Features of C++ and Visual C++.      

Wednesday 1.11.2006

Periodical Test 2.

Friday 3.11.2006

Applications: Object Oriented Software Engineering, Object Oriented Modeling, Notations.

Wednesday 8.11.2006

Applications: Object Oriented Operating Systems, Design Methodology and Features.

Friday 10.11.2006

Applications: Object Oriented and Object Relational Databases, Main Features.

Wednesday 15.11.2006

General Discussion and Review of Previous Year’s Question Papers.

 

Laboratory Assignment 1  

 

(To be submitted latest by 01.11.2006)

 

 1.     Implement and test the following member functions for a string class:

             (a)    int numwords( )  – that returns the number of words in the string.

             (b)    int capitalize( )    -  that capitalizes all the words in the string.

             (c)    void reverse( )     – that reverses the string.

             (d)    int palindrome( )  – that returns 1/0 according to whether the string is palindrome or not.

2.       2.   Write appropriate class definition to create a linked list of items. Write following member functions:

             (a)    void display( ) – that displays the contents of the list.

             (b)    void insert( )   -  that inserts an element at a specified position.

3.      3.    Write appropriate class definition to create a Queue of items. Write following member functions:

             (a)    void insert( )   -  that inserts an element at the rear end of the Queue.

             (b)    void delete( )   -  that deletes an item from the Queue.

4.       4.    Write appropriate class definition to create a weighted Graph. Write appropriate member functions to:

             (a)    return the Breadth First Traversal of the graph.

             (b)    return the Depth First Traversal of the graph.

             (c)    return a minimum cost spanning tree for the graph.

5.       5.  Write Programs to solve the following problems using Backtracking:

 (a) N Queens problem                    (b) Graph Coloring problem

 (c) Sum of Subset problem where,

  No. of subsets n = 6      Sum of Subsets = 30

  Weights (w1, w2, w3, w4, w5, w6) = (5, 10, 12, 13, 15, 18)

 6.  Write a program in C++ to create a Class Matrix whose elements are complex numbers.

      Perform following operations:

       (a)  Overload * operator to multiply two matrices.

       (b)  Overload -- operator to compute complex conjugate of a matrix.

       (c)  Overload ~ operator to compute transpose of a matrix.

       (d)  Overload ++ to check whether a matrix is unitary or not.

       Note: A square matrix A with complex elements is unitary if A’s product with its conjugate transpose

                  ( ~ (--A ) ) is identity matrix.  

 

Laboratory Assignment 2

 

(To be submitted latest by 25.11.2006)  

 

1.   Write a program in C++ to implement a class Stack and use it to check whether a given input string is

      palindrome or not.

 

   

Semester End Examination: First / Second week of December