This document provides an overview of C++ programming, including its characteristics as an object-oriented language, key concepts like objects and classes, and the basic structure of a C++ program. It describes how C++ supports data abstraction, encapsulation, inheritance, and polymorphism. Examples are given of a simple C++ program structure with a main function and additional functions. The translation process from C++ source code to an executable program is also outlined.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
28 views15 pages
DR M. Arifur Rahman: PHY-206 Cpna
This document provides an overview of C++ programming, including its characteristics as an object-oriented language, key concepts like objects and classes, and the basic structure of a C++ program. It describes how C++ supports data abstraction, encapsulation, inheritance, and polymorphism. Examples are given of a simple C++ program structure with a main function and additional functions. The translation process from C++ source code to an executable program is also outlined.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15
PHY-206
CPNA
Dr M. Arifur Rahman Associate Professor Content
Development and Properties of C++
Object-Oriented Programming Developing a C++ Program A Beginner’s C++ Program Structure of Simple C++ Programs
11/17/20 A Complete Guide to Programming in C++ 2
Introduction
This chapter describes the fundamental
characteristics of the object oriented C++ programming language. In addition, you will be introduced to the steps necessary for creating a fully functional C++ program. The examples provided will help you retrace these steps and also demonstrate the basic structure of a C++ program.
11/17/20 A Complete Guide to Programming in C++ 3
Characteristics
11/17/20 A Complete Guide to Programming in C++ 4
Characteristics of C++ Efficient, close to the machine programming Portable programs for various platforms. The large quantities of existing C source code used in C++.
C++ supports the concepts of object-oriented programming
(or OOP for short), which are: Data abstraction, that is, the creation of classes to describe objects Data encapsulation for controlled access to object data. Inheritance by creating derived classes polymorphism (Greek for multiform), can have varying effects during program execution.
11/17/20 A Complete Guide to Programming in C++ 5
Traditional Concept of programming
11/17/20 A Complete Guide to Programming in C++ 6
Object Oriented programming
11/17/20 A Complete Guide to Programming in C++ 7
Object
An object is a component of a program that knows
how to perform certain actions and how to interact with other elements of the program. Objects are the basic units of object-oriented programming. A simple example of an object would be a person.
11/17/20 A Complete Guide to Programming in C++ 8
Advantages:
Reduced susceptibility to errors
Easy re-use: objects maintain themselves and can therefore be used as building low maintenance requirement.
11/17/20 A Complete Guide to Programming in C++ 9
Translating a C++ program
11/17/20 A Complete Guide to Programming in C++ 10
Error Troubleshooting
If the source file contains just one syntax error,
the compiler will report an error. Additional error messages may be shown if the compiler attempts to continue despite having found an error. So when you are troubleshooting a program, be sure to start with the first error shown.
11/17/20 A Complete Guide to Programming in C++ 11
Sample Program
11/17/20 A Complete Guide to Programming in C++ 12
Main()
11/17/20 A Complete Guide to Programming in C++ 13
A C++ program with several functions
11/17/20 A Complete Guide to Programming in C++ 14
A C++ program with several functions
11/17/20 A Complete Guide to Programming in C++ 15