Write a c++ programthat will keep track of planets. Your program will display a menusimilar to this:
- Add Planet
- Delete Planet
- Search for Planet
- List Planets
- Sort Planets
- Write Planets to File
Your program will bebased on the planet-class you developed for an earlier assignment.It will store the planet’s name, diameter, and mass and store thelist in a vector. Your class will provide functions to calculatethe surface area and density of the planet as well as accelerationdue to gravity at the planet’s surface(g). Assume that planets arespheres.
When displaying anyinformation about a planet (option 3,4,6) – always display name,diameter, mass, density surface area, and g.
For options 2 and 3,the program will prompt the user for the name of the planet toeither search or delete, not the position.
Option 5 will sort theplanets alphabetically by name.
Option 6 will promptthe user for the name of the file to write the output to.
If you insert theplanets into the vector using an insertion sort, then option 5(Sort Planets) is not required.
Answer to Write a c++ program that will keep track of planets. Your program will display a menu similar to this: Add Planet Delete…