#[cfg(feature = "calculate")]
pub fn calculate(num1: f64, num2: f64, operator: &str) -> Result<f64,String> {
    match operator {
        "+" => Ok(num1 + num2),
        "-" => Ok(num1 - num2),
        "*" => Ok(num1 * num2),
        "/" => {
            if num2 == 0.0 {
                Err(String::from("Division by zero is not allowed!"))
            } else {
                Ok(num1 / num2)
            }
        }
        _=> Err(String::from("Invalid operator! Please use +,-,*,/."))
    }
}

#[cfg(feature = "input")]
pub fn get_input(prompt: &str) -> String {
    println!("{}", prompt);
    let mut input = String::new();
    io::stdin()
        .read_line(&mut input)
        .expect("Failed to read line");
    input.trim().to_string()
}

#[cfg(feature = "hello")]
pub fn say_hello(name: &str) -> String {
    format!("Hello, {}", name)
}

#[cfg(feature = "bye")]
pub fn say_goodbye(name: &str) -> String {
    format!("Goodbye, {}", name)
}