15SE201J OBJECT ORIENTED PROGRAMMING USING C++
John Blesswin A, Srinivasan R and Iniyan S [Staff Room No. UB810]
SRM University, Chennai
Need of Object-Oriented Programming - Comparison of procedural programming and Object-Oriented Programming - Characteristics of Object-Oriented Languages - C++ Programming Basics: Basic Program Construction - Data Types, Variables, Constants - Type Conversion, Operators, Library Functions - Loops and Decisions, Structures - Functions : Simple Functions, Passing arguments, Returning values, Reference Arguments. - Recursion, Inline Functions, Default Arguments - Storage Classes - Arrays , Strings
CAT Test 1 Questions | CAT Test 1 Answers
CAT Test 2 Questions | CAT Test 2 Answers
UNIT II Features of Object Oriented Programming
Introduction to Classes and Objects Constructors and its types, Destructors - Passing Objects as Function arguments and Returning Objects from Functions - Operator Overloading Inheritance - Overloading Member Functions Pointers - Virtual Functions – Friend Functions, Static Functions.
UNIT III Streams and Files
Streams: Classes and Errors, Disk File I/O with Streams - - Files: File Pointers - Error handling in File I/O - File I/O with member Functions - Overloading the extraction and Insertion Operators - Multi File Programs
UNIT IV Templates and Exception
Templates : Function templates, Class templates - Exceptions: Need of Exceptions, keywords, Simple and Multiple Exceptions - Re-throwing Exception and Exception Specifications, Custom Exception
UNIT V Standard Template Library
Introduction to STL: Containers, Algorithms, iterators - potential problems with STL - Algorithms: find(), count(), sort(),search(),merge() - Function Objects: for_each() , transform() - Sequence Containers: vectors, Lists, Dequeues - Iterators and specialized iterators
Download GCC Compiler : 1. For Windows/Linux Link 2. For Apple Mac OSX Link
[ For observation, need to write the following:
1. Question name 2. Question Description 3. Aim 4. Flowchart 5. Source code 6. Output 7. Result ]
Model Practical Exam: 6th to 19th of October
University Practical Exam: from 31st of October
[ For Record need to do the following:
Aim,Algorithm and result must be hand written , program and output must be in print out form ]
1. Identifying appropriate data types, variables and simple programs to understand the basic program. Write a c++ program to find the size of various datatypes.
2. Programs for control structures and loops . Write a C++ Program to find factorial of a number.
3. Simple Programs to construct a class structure with methods and arguments. Create a structure called person, has char name, int age, float salary. In the main function, set the values of the variables and display the information using displayData() function.
[Sample input/output for exercise 1,2,3]
4. A. C++ Program to calculate the area and perimeter of rectangles using concept of Hierarchical inheritance. Area class is derived from base class Rectangle. Perimeter class is derived from base class Rectangle.
B. C++ program to create Employee and Student inheriting from Person using Hierarchical Inheritance.
5. Write a c++ program to display the value of various type of variables using overloaded print() function.
6. Write a Inline function called zero_small() that has two integer arguments being passed by reference and sets the smaller of the two numbers to 0. Write the main program to access the function.
[Sample input/output for exercise 4,5,6]
7. Write a C++ program for Function Overloading, create a function print() is being used to print different data types
8. Write a C++ program to perform manipulation of complex numbers using operator overloading and type conversions.
Create a class named Complex to represent a complex number (with two private data members real and image of type double) and include appropriate constructors and member functions. Include member functions to overload + and - operators.
9. This program asks the user to enter 2 integers. There is another variable 'ans' that stores their sum. The sum is to be calculated in a function called sum() which takes three arguments: two integers and one integer pointer. In the main function, the reference of the variable 'ans' has been passed to sum(). You need to save the sum of the two numbers inside the third argument.
10. Assuming that a text file named FIRST.TXT contains some text written into it, write a function named copyupper(), that reads the file FIRST.TXT and creates a new file named SECOND.TXT contains all words from the file FIRST.TXT in uppercase.
11. Write c++ program to implement queue using class template.
12. Write a c++ program to perform validation on Employee online registration form using Exception handling.
[Sample input/output for exercise 7-12]