/*
create a struct to store information about a car, including its model, number of seats, and current gear, then add a method to change gears up or down. Have a think about variables and access control: what data should be a variable rather than a constant, and what data should be exposed publicly? Should the gear-changing method validate its input somehow?
*/structCar{staticlet maxGear =10staticlet minGear =1var model ="no model"var seats =4private(set)var currentGear = Car.minGear
init(model:String, seats:Int){self.model = model
self.seats = seats
}mutatingfuncgearUp(){if currentGear < Car.maxGear{ currentGear +=1}}mutatingfuncgearDown(){if currentGear > Car.minGear{ currentGear -=1}}}var myUte = Car(model:"Rodeo", seats:2)print("My \(myUte.model) has \(myUte.seats) seats and is in gear: \(myUte.currentGear)")myUte.gearDown()print("My \(myUte.model) has \(myUte.seats) seats and is in gear: \(myUte.currentGear)")myUte.gearUp()print("My \(myUte.model) has \(myUte.seats) seats and is in gear: \(myUte.currentGear)")