if else if else does actually not represent the logic behind a switch instruction. In a switch instruction you have multiple possibilities and a default case. If you want to rebuild switch you can do it the closest way like this:
Code:
if (condition1){
  doSomething()1;
}
if (condition2){
  doSomething()2;
}
doSomethingDefault();

So there is no need (and even no sense) in using else branches and counting brackets. The breaks of the switch instruction can be easily simulated by goto. I wouldn't recomment using loops and breaks for this case as a loop suggests other readers of your code that you want to do somehting totally different.


Always learn from history, to be sure you make the same mistakes again...