#include <iostream>
using namespace std;
double add(double x, double y) { return x + y;}
double mul(double x, double y) { return x * y;}
double sub(double x, double y) { return x - y;}
double divi(double x, double y) { 
    if (y != 0) {
        return x / y;
    }
    else {
        cout << "Error : division by zero";
        return 0;
    }
    }
    
int main () { 
    double price1, price2;
    int operationChoice;
    cout << "Enter the price of the first item:";
    cin >> price1;
    cout << "Enter the price of the second item:";
    cin >> price2;
    cout << "Choose the operation (1 for add, 2 for mul, 3 for sub, 4 for divi) ";
    cin >> operationChoice;
    if (operationChoice == 1) { 
        cout << add(price1, price2);
    }
    else if (operationChoice == 2) { 
        cout << mul(price1, price2);
    }
    else if (operationChoice == 3) { 
        cout << sub(price1, price2);
    }
    else if (operationChoice == 4) { 
        cout << divi(price1, price2);
    }
    else { 
        cout << "Invalid choice, try again";
    }
    return 0;
    }
