Advertisement
adolphuZ

Untitled

Jun 6th, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. def main():
  2.     # Prototypy samochodów
  3.     tesla_prototype = ElectricCar("Tesla Model S", 100)
  4.     bmw_prototype = GasolineCar("BMW 3 Series", 2.0)
  5.  
  6.     # Fabryki samochodów
  7.     electric_car_factory = ElectricCarFactory(tesla_prototype)
  8.     gasoline_car_factory = GasolineCarFactory(bmw_prototype)
  9.  
  10.     # Tworzenie samochodów za pomocą fabryk
  11.     electric_car1 = electric_car_factory.create_car()
  12.     electric_car2 = electric_car_factory.create_car()
  13.     gasoline_car1 = gasoline_car_factory.create_car()
  14.     gasoline_car2 = gasoline_car_factory.create_car()
  15.  
  16.     # Wyświetlanie specyfikacji samochodów
  17.     print(electric_car1.specifications())
  18.     print(electric_car2.specifications())
  19.     print(gasoline_car1.specifications())
  20.     print(gasoline_car2.specifications())
  21.  
  22. if __name__ == "__main__":
  23.     main()
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement