Search⌘ K

Challenge 1: Rearranging a Class

Explore how to apply data hiding and abstraction by separating a C++ class into header and implementation files. This lesson guides you through moving class definitions and function implementations out of the main application code, helping you organize code efficiently and adhere to object-oriented principles.

Problem Statement

We have provided you the implementation for the Planet class. Your task is to ensure abstraction by splitting up the code into header and .cpp files.

In the code below, Planet.h and Planet.cpp are empty, whereas main.cpp contains the full implementation. The class ...