Object-Oriented Programming in C++ By Robert Lafore

Object-Oriented Programming in C++ Pdf

Download Free Object-oriented programming in Microsoft C++ Pdf

Introduction: Object-Oriented Programming in C++ Pdf

Getting Started With Object-Oriented Programming in C++ Pdf, This book (Object-Oriented Programming in C++ Pdf) teaches you how to write programs in a C++ programming language. However, it does more than that. In the past few years, several major innovations in software development have appeared on the scene. This book teaches C++ in the context of these new developments. Let’s see what they are.
Programming Innovations
In the old days, 20 or so years ago, programmers starting a project would sit down almost immediately and start writing code. However, as programming projects became large and more complicated, it was found that this approach did not work very well. The problem was complexity.
Large programs are probably the most complicated entities ever created by humans. Because of this complexity, programs are prone to error, and software errors can be expensive and even life-threatening (in air traffic control, for example). Three major innovations in programming have been devised to cope with the problem of complexity. They are
• Object-oriented programming (OOP)
• The Unified Modeling Language (UML)
• Improved software development processes

Object-Oriented Programming in C++ Chapters and Sections

Table Of Contents For Object-Oriented Programming in C++ Pdf

Introduction

1 The Big Picture

Why Do We Need Object-Oriented Programming?
Procedural Languages
The Object-Oriented Approach
Characteristics of Object-Oriented Languages
Objects
Classes
Inheritance
Reusability
Creating New Data Types
Polymorphism and Overloading
C++ and C
Laying the Groundwork
The Unified Modeling Language (UML)
Summary
Questions

2 C++ Programming Basics

Getting Started
Basic Program Construction
Functions
Program Statements
Whitespace
Output Using cout
String Constants
Directives
Preprocessor Directives
Header Files
The using Directive
Comments
Comment Syntax
When to Use Comments
Alternative Comment Syntax
Integer Variables
Defining Integer Variables
Declarations and Definitions
Variable Names
Assignment Statements
Integer Constants
Output Variations
The endl Manipulator
Other Integer Types
Character Variables
Character Constants
Initialization
Escape Sequences
Input with cin
Variables Defined at Point of Use
Cascading
Expressions
Precedence
Floating Point Types
Type float
Type double and long double
Floating-Point Constants
The const Qualifier
The #define Directive
Type bool
The setw Manipulator
Cascading the Insertion Operator
Multiple Definitions
The IOMANIP Header File
Variable Type Summary
unsigned Data Types
Type Conversion
Automatic Conversions
Casts
Arithmetic Operators
The Remainder Operator
Arithmetic Assignment Operators
Increment Operators
Library Functions
Header Files
Library Files
Header Files and Library Files
Two Ways to Use #include
Summary
Questions
Exercises

3 Loops and Decisions

Relational Operators
Loops
The for Loop
Debugging Animation
for Loop Variations
The while Loop
Precedence: Arithmetic and Relational Operators
The do Loop
When to Use Which Loop
Decisions
The if Statement
The if…else Statement
The else…if Construction
The switch Statement
The Conditional Operator
Logical Operators
Logical AND Operator
Logical OR Operator
Logical NOT Operator
Precedence Summary
Other Control Statements
The break Statement
The continue Statement
The goto Statement
Summary
Questions
Exercises

4 Structures

Structures
A Simple Structure
Defining the Structure
Defining a Structure Variable
Accessing Structure Members
Other Structure Features
A Measurement Example
Structures Within Structures
A Card Game Example
Structures and Classes
Enumerations
Days of the Week
One Thing or Another
Organizing the Cards
Specifying Integer Values
Not Perfect
Other Examples
Summary
Questions
Exercises

5 Functions

Simple Functions
The Function Declaration
Calling the Function
The Function Definition
Comparison with Library Functions
Eliminating the Declaration
Passing Arguments to Functions
Passing Constants
Passing Variables
Passing by Value
Structures as Arguments
Names in the Declaration
Returning Values from Functions
The return Statement
Returning Structure Variables
Reference Arguments
Passing Simple Data Types by Reference
A More Complex Pass by Reference
Passing Structures by Reference
Notes on Passing by Reference
Overloaded Functions
Different Numbers of Arguments
Different Kinds of Arguments
Recursion
Inline Functions
Default Arguments
Scope and Storage Class
Local Variables
Global Variables
Static Local Variables
Storage
Returning by Reference
Function Calls on the Left of the Equal Sign
Don’t Worry Yet
const Function Arguments
Summary
Questions
Exercises

6 Objects and Classes

A Simple Class
Classes and Objects
Defining the Class
Using the Class
Calling Member Functions
C++ Objects as Physical Objects
Widget Parts as Objects
Circles as Objects
C++ Objects as Data Types
Constructors
A Counter Example
A Graphics Example
Destructors
Objects as Function Arguments
Overloaded Constructors
Member Functions Defined Outside the Class
Objects as Arguments
The Default Copy Constructor
Returning Objects from Functions
Arguments and Objects
A Card-Game Example
Structures and Classes
Classes, Objects, and Memory
Static Class Data
Uses of Static Class Data
An Example of Static Class Data
Separate Declaration and Definition
const and Classes
const Member Functions
const Objects
What Does It All Mean?
Summary
Questions
Exercises

7 Arrays and Strings

Array Fundamentals
Defining Arrays
Array Elements
Accessing Array Elements
Averaging Array Elements
Initializing Arrays
Multidimensional Arrays
Passing Arrays to Functions
Arrays of Structures
Arrays as Class Member Data
Arrays of Objects
Arrays of English Distances
Arrays of Cards
C-Strings
C-String Variables
Avoiding Buffer Overflow
String Constants
Reading Embedded Blanks
Reading Multiple Lines
Copying a String the Hard Way
Copying a String the Easy Way
Arrays of Strings
Strings as Class Members
A User-Defined String Type
The Standard C++ string Class
Defining and Assigning string Objects
Input/Output with string Objects
Finding string Objects
Modifying string Objects
Comparing string Objects
Accessing Characters in string Objects
Other string Functions
Summary
Questions
Exercises

8 Operator Overloading

Overloading Unary Operators
The operator Keyword
Operator Arguments
Operator Return Values
Nameless Temporary Objects
Postfix Notation
Overloading Binary Operators
Arithmetic Operators
Concatenating Strings
Multiple Overloading
Comparison Operators
Arithmetic Assignment Operators
The Subscript Operator ([])
Data Conversion
Conversions Between Basic Types
Conversions Between Objects and Basic Types
Conversions Between Objects of Different Classes
Conversions: When to Use What
UML Class Diagrams
Associations
Navigability
Pitfalls of Operator Overloading and Conversion
Use Similar Meanings
Use Similar Syntax
Show Restraint
Avoid Ambiguity
Not All Operators Can Be Overloaded
Keywords explicit and mutable
Preventing Conversions with explicit
Changing const Object Data Using mutable
Summary
Questions
Exercises

9 Inheritance

Derived Class and Base Class
Specifying the Derived Class
Generalization in UML Class Diagrams
Accessing Base Class Members
The protected Access Specifier
Derived Class Constructors
Overriding Member Functions
Which Function Is Used?
Scope Resolution with Overridden Functions
Inheritance in the English Distance Class
Operation of ENGLEN
Constructors in DistSign
Member Functions in DistSign
Abetting Inheritance
Class Hierarchies
“Abstract” Base Class
Constructors and Member Functions
Inheritance and Graphics Shapes
Public and Private Inheritance
Access Combinations
Access Specifiers: When to Use What
Levels of Inheritance
Multiple Inheritance
Member Functions in Multiple Inheritance
private Derivation in EMPMULT
Constructors in Multiple Inheritance
Ambiguity in Multiple Inheritance
Aggregation: Classes Within Classes
Aggregation in the EMPCONT Program
Composition: A Stronger Aggregation
Inheritance and Program Development
Summary
Questions
Exercises

10 Pointers

Addresses and Pointers
The Address-of Operator &
Pointer Variables
Syntax Quibbles
Accessing the Variable Pointed To
Pointer to void
Pointers and Arrays
Pointer Constants and Pointer Variables
Pointers and Functions
Passing Simple Variables
Passing Arrays
Sorting Array Elements
Pointers and C-Type Strings
Pointers to String Constants
Strings as Function Arguments
Copying a String Using Pointers
Library String Functions
The const Modifier and Pointers
Arrays of Pointers to Strings
Memory Management: new and delete
The new Operator
The delete Operator
A String Class Using new
Pointers to Objects
Referring to Members
Another Approach to new
An Array of Pointers to Objects
A Linked List Example
A Chain of Pointers
Adding an Item to the List
Displaying the List Contents
Self-Containing Classes
Augmenting LINKLIST
Pointers to Pointers
Sorting Pointers
The person** Data Type
Comparing Strings
A Parsing Example
Parsing Arithmetic Expressions
The PARSE Program
Simulation: A Horse Race
Designing the Horse Race
Multiplicity in the UML
UML State Diagrams
States
Transitions
Racing from State to State
Debugging Pointers
Summary
Questions
Exercises

11 Virtual Functions

Virtual Functions
Normal Member Functions Accessed with Pointers
Virtual Member Functions Accessed with Pointers
Late Binding
Abstract Classes and Pure Virtual Functions
Virtual Functions and the person Class
Virtual Functions in a Graphics Example
Virtual Destructors
Virtual Base Classes
Friend Functions
Friends as Bridges
Breaching the Walls
English Distance Example
friends for Functional Notation
friend Classes
Static Functions
Accessing static Functions
Numbering the Objects
Investigating Destructors
Assignment and Copy Initialization
Overloading the Assignment Operator
The Copy Constructor
UML Object Diagrams
A Memory-Efficient String Class
The this Pointer
Accessing Member Data with this
Using this for Returning Values
Revised STRIMEM Program
Dynamic Type Information
Checking the Type of a Class with dynamic_cast
Changing Pointer Types with dynamic_cast
The typeid Operator
Summary
Questions
Exercises

12 Streams and Files

Stream Classes
Advantages of Streams
The Stream Class Hierarchy
The ios Class
The istream Class
The ostream Class
The iostream and the _withassign Classes
Stream Errors
Error-Status Bits
Inputting Numbers
Too Many Characters
No-Input Input
Inputting Strings and Characters
Error-Free Distances
Disk File I/O with Streams
Formatted File I/O
Strings with Embedded Blanks
Character I/O
Binary I/O
The reinterpret_cast Operator
Closing Files
Object I/O
I/O with Multiple Objects
File Pointers
Specifying the Position
Specifying the Offset
The tellg() Function
Error Handling in File I/O
Reacting to Errors
Analyzing Errors
File I/O with Member Functions
Objects That Read and Write Themselves
Classes That Read and Write Themselves
Overloading the Extraction and Insertion Operators
Overloading for cout and cin
Overloading of Files
Memory as a Stream Object
Command-Line Arguments
Printer Output
Summary
Questions
Exercises

13 Multifile Programs

Reasons for Multifile Programs
Class Libraries
Organization and Conceptualization
Creating a Multifile Program
Header Files
Directory
Projects
Inter-File Communication
Communication Among Source Files
Header Files
Namespaces
A Very Long Number Class
Numbers as Strings
The Class Specifier
The Member Function
The Application Program
A High-Rise Elevator Simulation
Running the ELEV Program
Designing the System
Listings for ELEV
Elevator Strategy
State Diagram for the ELEV Program
Summary
Questions
Projects

14 Templates and Exceptions

Function Templates
A Simple Function Template
Function Templates with Multiple Arguments
Class Templates
Class Name Depends on Context
A Linked List Class Using Templates
Storing User-Defined Data Types
The UML and Templates
Exceptions
Why Do We Need Exceptions?
Exception Syntax
A Simple Exception Example
Multiple Exceptions
Exceptions to the Distance Class
Exceptions with Arguments
The bad_alloc Class
Exception Notes
Summary
Questions
Exercises

15 The Standard Template Library

Introduction to the STL
Containers
Algorithms
Iterators
Potential Problems with the STL
Algorithms
The find() Algorithm
The count() Algorithm
The sort() Algorithm
The search() Algorithm
The merge() Algorithm
Function Objects
The for_each() Algorithm
The transform() Algorithm
Sequence Containers
Vectors
Lists
Deques
Iterators
Iterators as Smart Pointers
Iterators as an Interface
Matching Algorithms with Containers
Iterators at Work
Specialized Iterators
Iterator Adapters
Stream Iterators
Associative Containers
Sets and Multisets
Maps and Multimaps
Storing User-Defined Objects
A Set of person Objects
A List of person Objects
Function Objects
Predefined Function Objects
Writing Your Own Function Objects
Function Objects Used to Modify Container Behavior
Summary
Questions
Exercises

16 Object-Oriented Software Development
Evolution of the Software Development Processes
The Seat-of-the-Pants Process
The Waterfall Process
Object-Oriented Programming
Modern Processes
Use Case Modeling
Actors
Use Cases
Scenarios
Use Case Diagrams
Use Case Descriptions
From Use Cases to Classes
The Programming Problem
Hand-Written Forms
Assumptions
The Elaboration Phase for the LANDLORD Program
Actors
Use Cases
Use Case Descriptions
Scenarios
UML Activity Diagrams
From Use Cases to Classes
Listing the Nouns
Refining the List
Discovering Attributes
From Verbs to Messages
Class Diagram
Sequence Diagrams
Writing the Code
The Header File
The .CPP Files
More Simplifications
Interacting with the Program
Final Thoughts
Summary
Questions
Projects

Download Now

Note: If you have any question about Download Free Object-Oriented Programming in C++ Pdf Then you can comment it.

Related Posts:


Be the first to comment

Leave a Reply

Your email address will not be published.


*