Here's the the question...
1. Declare an enumeration type consisting of the nine planets in their order by distance from the Sun (Mercury first, Pluto last).
2. Write a value-returning function that converts the name of a planet of the enumeration type declared in Step 1 into the corresponding string. The planet is an input parameter and the string is returned by the function. If the input is not a valid planet, return “Error”.
3. Write the main function with a For statement that prints out the names of the planets in order, using the enumeration type declared in Step 1 and the function declared in Step 2.
Here's what i've gotten so far...
#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
{
enum Planet {MERCURY, VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE, PLUTO};
string enump[] = {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"};
return 0;
}
I know im missing quite a few things i'm new to this and trying my best ... looking forward for your help ... thanx