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:
Add planet Add a new planet to the list
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
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
List All This option will display the planet information for each planet in the list
Sort by Name
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
