Skip to content

Instantly share code, notes, and snippets.

@AnasAlmasri
Created April 21, 2019 04:54
Show Gist options
  • Save AnasAlmasri/58f9d9dfab3ba87a38868efa39850557 to your computer and use it in GitHub Desktop.
Save AnasAlmasri/58f9d9dfab3ba87a38868efa39850557 to your computer and use it in GitHub Desktop.
private int performCalculations() {
switch (OPERATOR) {
case '+':
return FIRST_NUMBER + SECOND_NUMBER;
case '-':
return FIRST_NUMBER - SECOND_NUMBER;
case '*':
return FIRST_NUMBER * SECOND_NUMBER;
case '/':
return FIRST_NUMBER / SECOND_NUMBER;
case '^':
return FIRST_NUMBER ^ SECOND_NUMBER;
}
return -999;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment