I am teaching myself C# and the current chapter challenge asked me to:
Take your last project and create additional methods that subtract, multiply or divide the two
(1) switch is often a cleaner way to express this kind of branching. The major limitation of switch is that it only works on compile-time constant values (const variables, literal strings, ints, enums, etc.). In this case, that doesn't seem to be an issue, so switch would probably be a good choice for cleaner, slightly shorter code. In performance-sensitive code (which this is certainly not), a single switch can be faster than a bunch of ifs because the program will test the value and jump straight to the right case rather than testing against each if condition until reaching a match.
(2) an easy way to do this would be to wrap your entire program in a loop:
var retry = true;
while (retry)
retry = false;
// your program
else { // or default: if you're going with switch
...
retry = true;
}
}