Question: Create a Planet class(C++, include a .h file, cpp file, and driver file. The class should have functions to set and get the values of
Create a Planet class(C++, include a .h file, cpp file, and driver file. The class should have functions to set and get the values of the following member variables: name (a string), distance (a float) - representing the planet's distance from the sun, and gravity (a float) - representing the planet's gravity in relation to the Earth's gravity. (You can find actual values at http://nssdc.gsfc.nasa.gov/planetary/factsheet/planet_table_ratio.html. The driver file should declare an array of 7 Planet objects. A function in the driver should let the user input values for the different planets. Then, the driver should have a function to ask the user for a weight in pounds and the name of a planet. Another function should look for the planet in the array of Planets and return the weight the Earth weight would be on the other planet.
Step by Step Solution
There are 3 Steps involved in it
Heres a stepbystep solution for creating a Planet class in C with the specified files and functionality Step 1 Create Planeth Start by defining the Planet class in a header file Planeth that includes ... View full answer
Get step-by-step solutions from verified subject matter experts
