Roughly,
I built your scene. I generally use Cycles so there may be a better way in Internal, but this works pretty well.
First, add a material by clicking the (+) button. You will be presented with this page.
Make the suggested edits, such as changing the diffuse and specular colors and increasing the specular intensity from 0.5 to 0.7. You can rename the material to something like pill or resistor body.
Next, click the other plus button, the one next to the light grey drop down menu. This will give you a new material slot. Change the diffuse, specular, and intensity values for your next color (red, green, or orange according the picture). Repeat this step for the next two colors. Don't worry that they are not yet showing up on your model.
Now, press tab to enter edit mode and use Ctrl+R to add loop cuts. Do not left or right click yet. Press (4) at the top of your keyboard and move your mouse around your object until the loop cuts are positioned around the main cylindrical body.
Now left click to confirm. Change into edge select mode and select only the loop cuts you just made. It might help to hold Alt and right click on the edge. Key Ctrl+B and drag your mouse outward to create strips. Just don't drag too far. Change to face select mode. Select the faces where you want a certain color to be (using Alt+loop again), select that material in the materials panel, and click assign. You should now see a colored stripe on your model. Repeat for the other stripes.
Now tab back to object mode and change the rotation so that it is only rotated 90 on the x axis (no Z rotation.) Tab back into edit mode and select the smallest loop of faces on either end where you want the wires to be. Key E, S, Y, and drag outward to desired length. Now extrude once more, but just a little bit. Rotate each end 45 degrees on the x axis so they are pointed half downwards. Now key E, Z, and drag down a bit beyond the desired length. Tab out of edit mode.
Almost there...
Shift+A, Mesh, plane. S to scale it up. Drag down on the z so that only the resistor and the part of the wire that you want visible is showing.
Rendering
Go into the tools panel, the tools section, and shade Smooth. Drag the light over the resistor so that the shadow will cast directly down. In the light's object data panel, up the samples to 5. Set up the camera to point where you want it, up the resolution on the render panel to 100% (in the dimensions box). Click Render!
My finished result:
