| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Need some help with tricky C++ problem
Given single character codes for the colored bands that mark a resistor, compute its resistance in ohms. The color codes are as follows:
COLOR CODE Black 0 Brown 1 Red 2 Orange 3 Yellow 4 Green 5 Blue 6 Violet 7 Gray 8 White 9 If the integer codes of the bands (in order) color1, color2, and color3, then the resistance in ohms is: Resistance=(10*color1+color2)*10^color3 Sample program run: The colored bands are coded as follows: Color Code Black -> B Brown -> N Red -> R Orange -> O Yellow -> Y Green -> G Blue -> E Violet -> V Gray -> A White -> W Enter three color codes: ERO Resistance in ohms: 62000.0 |
|
#2
|
||||
|
||||
|
I charge $150 an hour for doing homework. If you're game, you get the DevArticles discount -- $125 an hour, 10-hour minimum.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Need some help with tricky C++ problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|