Question: Write a program that will keep track of a list of planets. Your program will use a menu similar to the one below: 1 .

Write a program that will keep track of a list of planets. Your program will use a menu similar to the one below:
1. Add planet (Add a new planet to the list)
2. Delete planet (This option will prompt the user for the name of a planet, then search through the list, locate the planet by name and remove it.)
3. Find planet (This option will prompt the user for the name of a planet, then search through the list, find the planet and display the planet information)
4. List All (This option will display the planet information for each planet in the list)
5. Sort by Name
6. Quit
Whenever planet information is to be displayed, the program will display the planet name, mass, diameter, surface area, density, and acceleration due to gravity.
You will need to create a class to store the planet information. The members of the planet class will be the planet name, mass and diameter. You'll need to provide member funtions to calculate the surface area, density and acceleration due to gravity for the planet. You'll also need a constructor as well as accessors and mutators for the name, diameter and mass.(The members should all be private).
You will need to implement one of the sorting algorithms discussed next week to sort your list of planets alphabetically.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!