Trouble with Enum

Reply

Join Date: Aug 2005
Posts: 14
Reputation: m7r23 is an unknown quantity at this point 
Solved Threads: 0
m7r23 m7r23 is offline Offline
Newbie Poster

Trouble with Enum

 
0
  #1
Sep 11th, 2005
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.
Attached Files
File Type: cpp Cpp7777.cpp (2.3 KB, 2 views)
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 108
Reputation: prog-bman is an unknown quantity at this point 
Solved Threads: 3
prog-bman prog-bman is offline Offline
Junior Poster

Re: Trouble with Enum

 
0
  #2
Sep 11th, 2005
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?
Join me on IRC:
Server: irc.daniweb.com
Channel: #C++

Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 14
Reputation: m7r23 is an unknown quantity at this point 
Solved Threads: 0
m7r23 m7r23 is offline Offline
Newbie Poster

Re: Trouble with Enum

 
0
  #3
Sep 12th, 2005
Originally Posted by prog-bman
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,078
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 142
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: Trouble with Enum

 
0
  #4
Sep 12th, 2005
Use an array of strings and look up the string.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum


Views: 1383 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC