function operate(op, num1, num2){
    let answer = 0;

    switch(op){
        case "+":
            answer = add(num1, num2);
            break;
        
        case "-":
            answer = subtract(num1, num2);
            break;
        
        case "/":
            if(num2 == 0){
                answer = 0;
                return "Nice try...";
            }
            answer = divide(num1, num2);
            break;
        
        case "*":
            answer = multiply(num1, num2);
            break;
    }
    return answer;
}
// This function takes an operator and two numbers then calls a function based on the operator symbol
This function takes an operator and two numbers then calls a function based on the operator symbol
This function takes an operator and two numbers then calls a function based on the operator symbol
function operate(op, num1, num2){
    let answer = 0;
    switch(op){
        case "+":
            answer = add(num1, num2);
            break;
        case "-":
            answer = subtract(num1, num2);
            break;
        case "/":
            if(num2 == 0){
                answer = 0;
                return "Nice try...";
            }
            answer = divide(num1, num2);
            break;
        case "*":
            answer = multiply(num1, num2);
            break;
    }
    return answer;
}
function operate ( op , num1 , num2 ) { let answer = 0 ; switch ( op ) { case "+" : answer = add ( num1 , num2 ) ; break ; case "-" : answer = subtract ( num1 , num2 ) ; break ; case "/" : if ( num2 == 0 ) { answer = 0 ; return "Nice try..." ; } answer = divide ( num1 , num2 ) ; break ; case "*" : answer = multiply ( num1 , num2 ) ; break ; } return answer ; }
This function takes an operator and two numbers then calls a function based on the operator symbol
This function takes an operator and two numbers then calls a function based on the operator symbol