// Four basic operations with switch
#include <iostream>
using namespace std;

int main()
{
  char op;
  float x, y;

  cout << "Input first number : "; cin >> x;
  cout << "Input an operator  : "; cin >> op;
  cout << "Input second number: "; cin >> y;

  switch( op ){
    case '+': cout << "sum = " << x + y << endl; break;
    case '-': cout << "difference = " << x - y << endl; break;
    case '*': cout << "multiplication = " << x * y << endl; break;
    case '/': cout << "ratio = " << x / y << endl; break;
    default : cout << "undefined operator: " << op << endl;
  }

  return 0;
}
