LISA for cosmologists: Calculating the signal-to-noise ratio for stochastic and deterministic sources