Resistor on frontend or rearend of hardware

The resistor is found after a push button switch in a circuit. The resistor is found before in a led or 8 ohm speaker. How do I know where the resistor would be placed if I were prototyping? 8)

encryptor:
The resistor is found after a push button switch in a circuit. The resistor is found before in a led or 8 ohm speaker. How do I know where the resistor would be placed if I were prototyping? 8)

It doesn't really matter. Put it after the LED if you want...it'll light up just the same.

How do I know where the resistor would be placed if I were prototyping?

It is all part of the design knowing if you need a resistor to limit any current on not.
Basically the switch resistor is a pull up or pull down resistor, these are needed.
The arduino can not supply enough current to drive a low impedance speaker, the current must be kept below 40mA. So an 8 ohm speaker would give you a current of 5 / 8 = 625mA if connected up directly. This will damage your arduino. So the maximum load on a pin would be 5 / 0.04 = 125 Ohms, therefore you need a 125 - 8 = 117 ohm resistor in line with an 8 ohm speaker. That is going to make the volume very low, but that is another problem.

Well If the OP made the mistake He'd have to be deaf and blind... No Worries tho... @625 mA that Speaker ain't long for this world.

Bob

Docedison:
Well If the OP made the mistake He'd have to be deaf and blind... No Worries tho... @625 mA that Speaker ain't long for this world.

Bob

Yeah, a whole 3 watts...deafening!