No, that won't work.
Look at your code, and it's obvious that its isn't right: which one of the switch statements is going to be executed? None of them - because
is always an empty string.
For starters, don't use
to convert numbers: use
or better, use
instead. And what I'd suggest is writing a method to return a number:
private static double GetNumber(string prompt)
string inp = Console.ReadLine();
if (double.TryParse(inp, out result))
Console.WriteLine("I'm sorry, but that wasn't a valid number. Please try again.");
} while (true);
You can then call that twice to fetch the two operands.
Then use Console.ReadLine to fetch the operator, and execute the switch statement on the user input.