One of the themes in this book is that object orientation is a way to create fundamental new data types—types that, if useful enough, can be reused in multiple programs.
An important aspect of types is that you can initialize them. It’s also reasonable to ask to do this with objects as well to be able to initialize them upon construction. In fact, that makes object-oriented syntax much more convenient and programmer-friendly.
A constructor is essentially an initialization function. Welcome to the craft of C++ construction.
A constructor tells the compiler how to interpret declarations like this:
Fraction a(1, 2); //a = 1/2
Given what you’ve seen of ...