struct Car { brand:String, model:String, year:u16}

fn main()
{
    let car1 = Car{
        model: String::from("Model S"),
        brand: String::from("Tesla"),
        year: 2020
    };
    let car2 = Car{
        model: String::from("Model 3"),
        brand: String::from("Tesla"),
        year: 2017
    };
    let car3 = Car{
        model: String::from("Model X"),
        brand: String::from("Tesla"),
        year: 2015
    };
    print_car_info(car1);
    print_car_info(car2);
    print_car_info(car3);
}

fn print_car_info(car:Car)
{
    println!("{} {} made in {}.", car.brand, car.model, car.year);
}
