I think I pretty much set up my enum right to the below. I just dont know what to do with it.


PRoblem Description
A type named Color declared by "enum" to contain only
black, blue, purple, red, white, and yellow.

For each set of inputs, output their sum, average,
maximum and second largest.

Sample output
Enter values 0 to 5 to represent different colors, terminated with -999:
0, 1, 2, -999
sum is 3, reprenting color purple
average is 1, color is blue,
Largest is 2, color is red,
Second largest is 1, color is blue.

Recommended Answers

All 3 Replies

So what exactly is your question? Do you need to know how to average, find the second highest, print out the color assiocated with the number?

So what exactly is your question? Do you need to know how to average, find the second highest, print out the color assiocated with the number?

Print out the color associated with the number.

Use an array of strings and look up the string.

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.