Вы находитесь на странице: 1из 24

COMPUTER PROGRAMMING

(OBJECT ORIENTED
PROGRAMMING)
CSN104
COURSE DETAILS

Course : COMPUTER PROGRAMMING


Name (OBJECT ORIENTED PROGRAMMING)
Course : CSN104
Code
Credits : 4
LTP : 302
Course Objective:
The students should be able to understand the fundamentals of
C++, including the use of object-oriented programming like
classes, objects, constructors, polymorphism, inheritance,
exception and file handling
SYLLABUS

Lecture wise breakup Number


of
Lectures
1 INTRODUCTION TO PROGRAMMING 6
Evolution of languages: Machine languages, Assembly languages,
High-level languages. Software requirements for programming:
System softwares like operating system, compiler, linker, loader;
debugging, Algorithm, specification of algorithm. Flowcharts. Logic
building for practical problems
2 C++ CONSTRUCTS 8
Various data types, Tokens, Variable declarations and scope,
Expressions and conditional statements (if, if-else, nested if else),
iterative statements (for, while, do while), jump statements (goto,
break, continue), switch-case, Operators and Precedence,
typecasting
SYLLABUS

Lecture wise breakup Number


of
Lectures
3 FUNCTIONS, ARRAYS and POINTERS 7
Function prototyping, Function declaration and calling, Inline and
static functions. Concept, declaration and use of arrays, 2-
dimensional arrays. , Introduction to Pointers, Strings
4 CLASSES, CONSTRUCTORS AND DESTRUCTORS 7
Concept of classes and objects, Memory allocation for classes and
objects. Arrays of objects, friend functions, Constructor and
Destructor types, dynamic memory allocation.
5 POLYMORPHISM and INHERITANCE 8
Function and Operator overloading, overloading using friend
Functions,
Base classes and Derived classes, types of inheritance, Invocation
of Constructors and Destructors in Inheritance, Use of this Pointer,
Pointer to derived and base classes, virtual functions, Bindings,
Pure virtual Functions, abstract classes.
SYLLABUS

Lecture wise breakup Number


of
Lectures
6 EXCEPTION and FILE HANDLING 6
Exception types, using try and catch, multiple catch classes,
nested try statement, creating user defined exceptions, Concept of
files, file pointers, Operations on file
List of Experiments: Number of
Turns
1 Implement various C++ constructs 2
2 Implement functions, arrays and pointers 2
3 Implement classes and objects 1
4 Implement constructors and destructors 2
5 Implement operator and function overloading 2
6 Implement Inheritance 1
7 Implement run time polymorphism 2
8 Implement exception and file handling 2
Course Outcomes: At the end of the course, students will be able to:
1 Develop understanding of the fundamental concepts, methodologies
and constructs which are essential for C++ programming.
2 Construct C++ classes and apply various object oriented
programming concepts with proficiency
3 Apply good programming principles to the design and
implementation of C++ programs
4 Discover errors in a C++ program and describe how to fix them
BOOKS

Sr. Name of Book/ Authors/ Publisher Year of


No. Publication/
1 C++ Primer, 5th Edition, Pearson Education Inc. 2012
2 Object Oriented Programming in C++, Robert Lafore, 2001
4th Edition, SAMS
3 C++ Primer Plus By Prata, Pearson Education 2012
4 C++:The Complete Reference, By Schildt, McGraw- 2003
Hill
5 Object Oriented Programming with C++, 2008
Balaguruswamy, Tata Mc Graw Hill
6 C++ How to Program, Harvey M. Deitel Paul Deitel 2017
EVALUATION SCHEME

• MST 20 marks
• EST 40 marks
• Assignments 20 marks
• Quiz 20 marks
• Total 100 marks
WHY STUDY PROGRAMMING??

• Industrial Revolution 4.0 which is the current technological age, is


based on Artificial Intelligence, Machine Learning, Internet of Things,
Big Data, Blockchain, Robotics etc. In Short- a fusion of technologies.
• India has become the 4th country in the world after USA, China and
Japan, where World Economic Forum has opened a centre for 4th
Industrial Revolution. [Mumbai]
• Our country is moving towards a digital and technological
transformation through various schemes such as Skill India, Startup
India, Atal Innovation Mission, Digital India so on so forth.
EVOLUTION OF LANGUAGES
SOFTWARE REQUIREMENTS

Operating System is an interface


between the user of the computer and
the hardware
MinGW (Minimalist GNU for Windows)
COMPILER GCC COMPILER

DOWNLOAD AND INSTALLATION STEPS:


https://www.ics.uci.edu/~pattis/common/handouts/mingweclipse/ming
w.html

Note: GNU is a recursive acronym for "GNU's Not


Unix!"
C++ is CASE SENSITIVE

#include <iostream> • Save using .cpp extension in Bin folder


using namespace std; inside MinGW folder in C drive
• Then open command prompt in that very
path
• Suppose the name of your file is test.cpp
int main() • To compile: g++ test.cpp
{ • To run: a

cout<<"First C++ Program";


return 0;
LINKER AND LOADER
}
LINKER AND LOADER

• Linker or link editor is a computer utility program that


takes one or more object files generated by a compiler and
combines them into a single executable file, library file, or
another 'object' file.

• Loader is the part of an operating system that is


responsible for loading programs and libraries. It is one of
the essential stages in the process of starting a program,
as it places programs into memory and prepares them for
execution.
COMPILE

RUN/EXECUTE
ANOTHER C++ PROGRAM
// Adding two number
#include<iostream.h>
#include<conio.h>
using namespace std;

int main()
{
 int a,b,c;
cout<<"enter Two Number "<<endl;
cin>>a>>b;
c=a+b;
cout<<" the value of a = "<<a<<endl;
cout<<" the value of b  = "<<b<<endl;
cout<<"Sum of a and b = "<<c<<endl;
return 0;

 }
C++ PROGRAM USING CLASSES AND OBJECTS
// Adding two number using class (C++)
#include<iostream.h>
#include<conio.h>
using namespace std;
class add
{
 private:
     int a,b,c; int main()
 public: {
      void read()   add x; // x is a object of add class
   {
cout<<"enter Two Number "<<endl;
  x.read();
cin>>a>>b;   x.sum();
   }   x.display();
      void display()   return 0;
   {
cout<<" A  = "<<a<<endl; }
cout<<" B  = "<<b<<endl;
cout<<"Sum = "<<c<<endl;
   }
      void sum()
   {
       c= a+b;
   }
};
MORE PROGRAMS TO PRACTICE IN FIRST LAB

• C++ Program to Print Number Entered by User


• C++ Program to Add Two Numbers
• C++ Program to Find Quotient and Remainder
• C++ Program to Find Size of int, float, double and char in Your System
• C++ Program to Swap Two Numbers

SOLUTIONS AVAILABLE AT: https://www.programiz.com/cpp-


programming/examples
FOR NEXT LECTURE

• Flowcharts and Algorithms

• How to draw a flowchart of a simple C++ program like addition of two


numbers? Just go through it once using internet.
THANK YOU

Вам также может понравиться