This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Those are not your real compiler errors; I don't get the first one about String and double when I try your code.
As for the second one, switch statements can only accept int and smaller (byte, short and char). long, float and double are not allowed. Also, you entire switch structure is illegal. Switch statements only work on exact values. For example:
You'll need to switch to an if-statement: