Module 14: Classes and Objects

Markdown

View as Markdown

Module Overview

This module introduces classes and objects in C++ programming, helping learners understand how data and functions are organised within class-based structures.

Learners will explore class and object specifications, defining data members and member functions, and working with arrays of objects.

The module also covers console input/output, C++ stream classes, formatted and unformatted I/O operations, and manipulators, helping learners develop a better understanding of how C++ programs interact with users and handle data.

What Will Be Covered

14.1 Classes and Object Specifier

Understand the concept of classes and objects in C++. Learn how classes define the structure and behaviour of objects and how objects are created and used to work with class-based program structures.

14.2 Defining Data Members and Member Functions

Learn how data members and member functions are defined within a class. Understand how data is stored and how functions are used to perform operations on class members.

14.3 Array of Objects

Explore how arrays of objects are used to store and manage multiple objects of the same class. Learn how objects can be organised and accessed using array elements.

14.4 Managing Console I/O

Understand how console input and output operations are used in C++ programs. Learn how to receive input from users and display program results through the console.

14.5 C++ Stream Classes

Explore the stream classes available in C++ and understand how they support input and output operations. Learn the role of streams in handling data between programs and input/output devices.

14.6 Formatted and Unformatted Console I/O

Learn the differences between formatted and unformatted console input/output operations. Understand how data can be displayed and received using different I/O techniques.

14.7 Usage of Manipulators

Understand how manipulators are used to control and format output in C++. Learn how manipulators help improve the presentation and readability of program output.

Skills You Will Gain

  • Understanding classes and objects in C++.

  • Defining data members and member functions.

  • Working with arrays of objects.

  • Managing console input and output.

  • Understanding C++ stream classes.

  • Applying formatted and unformatted I/O operations.

  • Using manipulators to format program output.

Learning Outcomes

By the end of this module, learners will be able to:

  • Explain the concept of classes and objects in C++.

  • Define and work with class data members and member functions.

  • Create and manage arrays of objects.

  • Implement console input and output operations.

  • Understand the role of C++ stream classes.

  • Perform formatted and unformatted console I/O.

  • Use manipulators to control output formatting.

Certification Alignment

This module develops object-oriented programming and console interaction skills that are essential for building C++ applications. The concepts covered support learners in progressing through the C++ curriculum and developing practical programming capabilities.

Continue to the Next Module

Continue to Module 15: Functions in C++ to learn about reference-based function operations, function overloading, default arguments, inline functions, static class members, friend functions and virtual functions.

Was this article helpful?

Still need help?

Contact us

C & C++ Programming

C & C++ Programming

Program RoadmapC,C++ Course Features C & C++ Prerequisites & Installation GuideGetting Started with C: Program Structure, Compilation, Execution, and DebuggingModule 1: Introduction to Programming LanguagesModule 2: C TokensModule 3: Control Statements and ExpressionsModule 4: LoopingModule 5: Arrays and StringModule 6: FunctionsModule 7: PointersModule 8: Structures and UnionsModule 9: File Handling Using CModule 10: Dynamic Memory AllocationModule 11: Storage Classes and Pre-processorModule 12: Introduction to Object-Oriented ProgrammingModule 13: C++ Tokens and Type CastingModule 14: Classes and ObjectsModule 15: Functions in C++Module 16: Constructors and DestructorModule 17: Operator OverloadingModule 18: InheritanceModule 19: Working with FilesModule 20: Exception HandlingUnderstanding C Tokens: Variables, Data Types, Constants, Operators, Scope, and LifetimeHow to Use Control Statements and Loops in CWorking with Arrays and Strings in CUnderstanding Functions in C: User-Defined Functions, Library Functions, and Parameter PassingUnderstanding Pointers in C: Pointer Basics, Pointer Arithmetic, Arrays, and FunctionsWorking with Structures and Unions in CFile Handling in C: Reading, Writing, Updating, and Managing FilesIntroduction to Object-Oriented Programming (OOP) and C++ BasicsUnderstanding C++ Tokens, Data Types, Operators, and Type CastingUnderstanding Classes and Objects in C++Working with Functions in C++: Overloading, Default Arguments, Inline, Static, Friend, and Virtual FunctionsUnderstanding Constructors and Destructors in C++Operator Overloading in C++Understanding Inheritance in C++