Comprehensive C++ Programming
Course Description
The Comprehensive C++ Programming Course is designed to provide participants with a solid foundation in C++ programming. This course focuses on core concepts, including procedural programming, object-oriented programming (OOP), data structures, and input/output operations. This course also covers some topics of the modern C++ (C++ 11, 14). Participants will gain practical knowledge through hands-on exercises and real-world examples. By the end of this course, participants will be equipped with the skills necessary to work with large and complex applications using OOP concepts such as classes, objects, data abstraction, data encapsulation, and procedural programming paradigms.
Duration
16 hours
Learning Outcomes
Upon completion of this course, participants will be able to:
– Differentiate between procedural and object-oriented programming concepts.
– Understand the basics of C++, including data types, variables, keywords, tokens, and expressions.
– Utilize programming constructs such as if statements, loops, switch statements, and control flow statements.
– Work with C++ data structures, including arrays, strings, structures, and pointers.
– Implement classes and objects, including methods, attributes, and arrays of objects.
– Explore C++ functions, including inline, virtual, static, and friend functions.
– Manage console input/output operations using cin and cout.
– Memory management
– Exception Handling
Prerequisites
Participants should have a basic understanding of programming concepts and familiarity with any programming language.
Detailed Content
Session 1: (4 hours)
C++ Basics
– Data Types: int, float, char, double, signed, unsigned, auto
– Variables and References: using &
– Keywords, Tokens, Expressions: understanding the rules
– Console I/O: working with cin and cout
– Hands-on Exercises:
- Declare variables of different data types and perform arithmetic operations.
- Accept user input using cin and display output using cout.
C++ Programming Constructs (2 hours)
– if, if…else, nested if statements
– while and while (1) loops
– for and arithmetic for loops
– switch statements
– break and continue statements
– Hands-on Exercises:
- Write a program to determine if a given number is even or odd using if statements.
- Implement a program that calculates the sum of numbers from 1 to N using loops and control flow statements.
Session 2: Composite Types (4 hours)
– Arrays: numeric and character arrays, multidimensional arrays
– Structures and Unions: their usage and differences
– Pointers and References: understanding their role
– Hands-on Exercises:
- Create an array of integers and perform operations such as sorting and searching.
- Define a structure to store student information and display it using pointers.
Session 3: Classes and Objects (4 hours)
– Concept of class and object
– Calling attributes and methods at class and object levels
– Class inside class
– Array of objects
– Polymorphism
– Hands-on Exercises:
- Implement a class to represent a bank account with deposit and withdrawal methods.
- Create an array of objects to manage a library system, including book borrowing and returning.
Session 4: Memory Management and Exception Handling (4 hours)
– Dynamic memory and smart pointers (raw pointers, unique_ptr, shared_ptr, weak_ptr)
– Hands-on exercise: respectively use raw pointer, unique_ptr and shared_ptr to manage the memory.
– Exception Handling (Optional)
– Hands-on exercise: throw exception and catch exception.