Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The class you will implement is called planet... C++ 1. Planet Class (Create a Header File) The class you will implement is called planet. We
The class you will implement is called planet...
C++
1. Planet Class (Create a Header File) The class you will implement is called planet. We have given you the class file planet.cpp. Create the header file for the planet class. Create the file planet.h in Cloud9 in the same directory as the main file. The planet class as: e two constructors planet() a default constructor (which takes no arguments) planet (string, float) a constructor that takes two arguments, the name of the planet and the radius of the planet (in km) o o e getters and setters for the class attributes. 2. Solar System Class (Create an Implementation File) The next class you will implement is called solarSystem. The solarSystem.h file is provided on moodle, and you will create your class file solarSystem.cpp There are four private attributes in this class 1. maxNumPlanets (the max number of planets in this solar system. This should be 2. 3. 4. set to 10) systemName (the name of the solar system) numPlanets (how many planets are in this solar system currently) systemPlanets (an array of planets in this solar system) The class should have the following methods (functions) one constructor . a destructor (no code needed in it, just a comment is enough) * getters for the class attributes systemName and numPlanets . addPlanet (string, float) should add a new planet into the solar system. . getPlanet(int) should return the the planet object of the index indicated by the argument o radiusDifference(planet, planet), that calculates the difference in radius between two planets (read the comments in solarSystem_main.cpp for more information)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started