| | |
Trouble with Enum
![]() |
•
•
Join Date: Aug 2005
Posts: 14
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Nov 2004
Posts: 108
Reputation:
Solved Threads: 3
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.
Server: irc.daniweb.com
Channel: #C++
Chat Via:
http://daniweb.com/chat/minichat.php
or
Your favorite IRC client.
![]() |
Similar Threads
- Hotmail Access Trouble (Web Browsers)
- Enum, struct, and pointer? (C)
- Trouble opening certain files... (Windows 95 / 98 / Me)
- Trouble installing Pather (OS X)
- Cool Web Search Trouble (HiJack Log inside) (Viruses, Spyware and other Nasties)
- sims trouble (Windows NT / 2000 / XP)
Other Threads in the C Forum
- Previous Thread: computation time for arithmeic operations
- Next Thread: procedure and object-oriented !
Views: 1383 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C
api array arrays binary binarysearch c++ char character code codes coke command conversion convert copyanyfile copypdffile database decimal directory dude dynamic ebooks error exec factorial fgets file files fork function functions getlogicaldrivestrin givemetehcodez global grade graphics hacking homework i/o ide input insert int integer lazy libcurl license line linked linkedlist linux list lists loop loops malloc matrix memory messagebox mysql no-effort number output path pause performance pointer pointers problem process program programming questions read recursion recursive recv reverse roman2decimal scanf socketprograming spoonfeeding sql static strchr string strings strtok structures student studio system turbo turbo-c unix user variable wab why-not-to-use-turbo windows






