I can\'t figure out how to use switches in combination with an enum. Could you please tell me what I\'m doing wrong, and how to fix it? I have to use an enum to make a basic
Your code is fine. In case you're not sure how to use Calculate function, try
Calculate(5,5,(Operator)0); //this will add 5,5
Calculate(5,5,Operator.PLUS);// alternate
Default enum values start from 0 and increase by one for following elements, until you assign different values. Also you can do :
public enum Operator{PLUS=21,MINUS=345,MULTIPLY=98,DIVIDE=100};