O'Reilly logo

Programming Like a Pro for Teens by Charles R. Hardnett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Object-Oriented Programming in C++: Part I

In This Chapter

  • Classes as Types

  • Case Study: Cyber Bank Application

  • Case Study: The Fraction Data Type

 

In C++ it’s harder to shoot yourself in the foot, but when you do, you blow off your whole leg.

 
 --Bjarne Stroustrup

Object-oriented programming (OOP) in C++ is centered on the class construct. You saw the class construct in Chapter 9, “Medium-Scale Problems,” where it was used to create data records for a database. However, the class has a much more important role in C++: creating abstract data types. An abstract data type (ADT) is a user-defined data type. These ADTs behave like the classes discussed in Chapter 10, “Introduction to Object-Oriented Design.” ADTs describe the structure (attributes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required