use std::io;

fn main() {
    println!("Convert Fahrenheit to Celsius");

    println!("Please enter the temperature in Fahrenheit.");

    let mut fahrenheit = String::new();

    io::stdin()
        .read_line(&mut fahrenheit)
        .expect("Failed to read line");

    let fahrenheit: f64 = fahrenheit
        .trim()
        .parse()
        .expect("Temperature entered was not a number");

    let celsius = 5.0 / 9.0 * (fahrenheit - 32.0);

    println!("The temperature in Celsius is: {celsius}");   

}
