Answered step by step
Verified Expert Solution
Link Copied!

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...

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

Why are supply chains complex to manage?

Answered: 1 week ago

Question

Why We Listen?

Answered: 1 week ago