1. Declare an enumeration type consisting of the 8 planets in their order by distance from the
    Sun (Mercury first then Sun to the last planet).
  2. Write a value-returning function that converts a planet of the enumeration type declared in
    Exercise 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 a For statement that prints out the names of the planets in order, using the
    enumeration type declared in Exercise 1 and the function declared in Exercise 2.

Recommended Answers

All 2 Replies

What do you have so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.