Пример #1
0
def main():

    car = vehicles.Car('BMW', 2001, 70000, 15000.0, 4)
    truck = vehicles.Truck('Toyota', 2002, 40000, 12000.0, '4WD')
    suv = vehicles.SUV('Volvo', 2000, 30000, 18500.0, 5)

    print('USED CAR INVENTORY')
    print('====================')

    print('The following car is in inventory:')
    print('Make:', car.get_make())
    print('Model:', car.get_model())
    print('Mileage:', car.get_mileage())
    print('Price:', car.get_price())
    print('Doors:', car.get_doors())
    print()

    print('The following pickup truck is in inventory:')
    print('Make:', truck.get_make())
    print('Model:', truck.get_model())
    print('Mileage:', truck.get_mileage())
    print('Price:', truck.get_price())
    print('Drive type:', truck.get_drive_type())
    print()

    print('The following SUV is in inventory:')
    print('Make:', suv.get_make())
    print('Model:', suv.get_model())
    print('Mileage:', suv.get_mileage())
    print('Price:', suv.get_price())
    print('Passanger Capacity:', suv.get_pass_cap())
    print()
Пример #2
0
def main():
    used_car = vehicles.Car('Audi', 2007, 12500, 21500.00, 4)

    truck = vehicles.Truck('Toyota', 2002, 40000, 12000.0, '4WD')

    suv = vehicles.SUV('Volvo', 2000, 30000, 18500.0, 5)

    #display data
    print('Make: ', used_car.get_make())
    print('Model: ', used_car.get_model())
    print('Mileage: ', used_car.get_mileage())
    print('Price: ', used_car.get_price())
    print('Doors: ', used_car.get_doors())
    print()

    #display truck
    print('Make: ', truck.get_make())
    print('Model: ', truck.get_model())
    print('Mileage: ', truck.get_mileage())
    print('Price: ', truck.get_price())
    print('Drive Type: ', truck.get_driver_type())
    print()

    #display SUV
    print('Make: ', suv.get_make())
    print('Model: ', suv.get_model())
    print('Mileage: ', suv.get_mileage())
    print('Price: ', suv.get_price())
    print('Passenger Capacity: ', suv.get_pass_cap())
Пример #3
0
def main():
    # create Car object
    car = vehicles.Car('Bugatti', 'Veyron', 0, 3000000, 2)

    # create a Truck object
    truck = vehicles.Truck('Dodge', 'Power Wagon', 0, 57000, '4WD')

    # create a SUV object
    suv = vehicles.SUV('Jeep', 'Wrangler', 200000, 5000, 4)

    print('VEHICLE INVENTORY')
    print('=================')

    # display the car data
    print('Make:', car.get_make())
    print('Model:', car.get_model())
    print('Mileage:', car.get_mileage())
    print('Price', car.get_price())
    print('Number of doors:', car.get_doors())
    # display the truck data
    print('Make:', truck.get_make())
    print('Model:', truck.get_model())
    print('Mileage:', truck.get_mileage())
    print('Price', truck.get_price())
    print('Drive Type:', truck.get_drive_type())
    # display the SUV data
    print('Make:', suv.get_make())
    print('Model:', suv.get_model())
    print('Mileage:', suv.get_mileage())
    print('Price', suv.get_price())
    print('Number of doors:', suv.get_pass_cap())
def main():
    # create a Car object
    car = vehicles.Car('Bugatti', 'Veyron', 0, 3000000, 2)

    # create a Truck object
    truck = vehicles.Truck('Dodge', 'Power Wagon', 0, 57000, '4WD')

    # create a SUV object
    suv = vehicles.SUV('Jeep', 'Wrangler', 200000, 5000, 4)

    print('Vehicle Inventory')
    print('=================')

    # Display the car's information
    print('Make: ', car.get_make())
    print('Model: ', car.get_model())
    print('Mileage: ', car.get_mileage())
    print('Price: ', car.get_price())
    print('# of Doors: ', car.get_doors())

    # Display the trucks's information
    print('Make: ', truck.get_make())
    print('Model: ', truck.get_model())
    print('Mileage: ', truck.get_mileage())
    print('Price: ', truck.get_price())
    print('Drive Type: ', truck.get_drive_type())

    # Display the suv's information
    print('Make: ', suv.get_make())
    print('Model: ', suv.get_model())
    print('Mileage: ', suv.get_mileage())
    print('Price: ', suv.get_price())
    print('Passenger Capacity: ', suv.get_pass_cap())
Пример #5
0
def main():
    #create a main function for storing the objects
    #start with the car by entering its input
    print("Please enter the data for the car :")
    make = input("Make type of the car: ")
    model = input("The Model of your car: ")
    mileage = input("Its Mileage: ")
    price = input("Its price: ")
    doors = input("Number of doors: ")
    #create the object cars to be used to access the car data
    cars = vehicles.Car(make, model, mileage, price, doors)

    print()
    #enter details for the suv vehicle
    print('SUV details')
    make = input("Make type of the SUV: ")
    model = input("The Model of your SUV: ")
    mileage = input("Its Mileage: ")
    price = input("Its price: ")
    pass_cap = input("Passenger capacity: ")
    #create aan object suv to be used to acces the suv data
    suv = vehicles.SUV(make, model, mileage, price, pass_cap)

    print()
    #Enter the details for the truck
    print("Trucks details ")
    make = input("Make type of the car: ")
    model = input("The Model of your car: ")
    mileage = input("Its Mileage: ")
    price = input("Its price: ")
    drive_type = input("Drve type i.e 4WD or 2WD: ")
    #cretae the object truct to be used to access the data for the truck
    trucks = vehicles.Truck(make, model, mileage, price, drive_type)
    #Dispaly the data you entered
    #We are using the fumctions plus the objects we have to display the data
    print("Here is the details for the cars in the inventory!!: ")
    print("CAR DETAILS: ")
    print("CAR Make type :", cars.get_make())
    print("Car Model: ", cars.get_model())
    print("Car Mileage: ", cars.get_mileage())
    print("Car cost: ", cars.get_price())
    print("Number of doors of the car: ", cars.get_doors())

    print("Here is the details for the suv vehicles in the inventory!!: ")
    print("SUV DETAILS: ")
    print("SUV Make type :", suv.get_make())
    print("SUV Model: ", suv.get_model())
    print("SUV Mileage: ", suv.get_mileage())
    print("SUV cost: ", suv.get_price())
    print("Total SUV capacity: ", suv.get_pass_cap())

    print("Here is the details for the trucks in the inventory!!: ")
    print("TRUCK DETAILS: ")
    print("SUV Make type :", trucks.get_make())
    print("Truck Model: ", trucks.get_model())
    print("Truck Mileage: ", trucks.get_mileage())
    print("Truck cost: ", trucks.get_price())
    print("Truck drive type: ", trucks.get_drive_type())
Пример #6
0
def make_models():
    _ = models.Sedan(2017, "Toyota", "Camary", "white", 4)
    vehicles[_.id] = _

    _ = models.Sedan(2017, "Toyota", "Camary", "red", 4)
    _.gas_level = 20
    vehicles[_.id] = _

    _ = models.Sedan(1999, "Toyota", "Camary", "green", 4)
    vehicles[_.id] = _

    _ = models.Sedan(2006, "Ford", "Fusion", "white", 3)
    _.has_flat = True
    vehicles[_.id] = _

    _ = models.Sedan(2006, "Nissan", "Altima", "gray", 4)
    vehicles[_.id] = _


    _ = models.Coupe(2009, "Ford", "Mustang", "red", 2)
    vehicles[_.id] = _

    _ = models.Coupe(2017, "Dodge", "Mustang", "white", 4)
    vehicles[_.id] = _

    _ = models.Coupe(2014, "Chevy", "Camaro", "white", 4)
    _.has_flat = True
    vehicles[_.id] = _

    _ = models.Coupe(2016, "Toyota", "86", "red", 3)
    vehicles[_.id] = _


    _ = models.Truck(2016, "Toyota", "Tacoma", "red", 4)
    vehicles[_.id] = _

    _ = models.Truck(2016, "Ford", "F150", "gray", 2)
    _.has_flat = True
    _.gas_level = 0
    vehicles[_.id] = _
Пример #7
0
def main():
    # Utworzenie obiektu Car przedstawiającego
    # używane czterodrzwiowe BMW z roku 2001
    # o przebiegu 70000 i cenie 15000.
    car = vehicles.Car('BMW', 2001, 70000, 15000.0, 4)

    # Utworzenie obiektu Truck przedstawiającego
    # używaną Toyotę o przebiegu 40000 w cenie
    # 12000 oraz z napędem na cztery koła.
    truck = vehicles.Truck('Toyota', 2002, 40000, 12000.0, '4WD')

    # Utworzenie obiektu SUV przedstawiającego
    # używane pięciomiejscowe Volvo z roku 2000
    # o przebiegu 30000 i cenie 18500.
    suv = vehicles.SUV('Volvo', 2000, 30000, 18500.0, 5)

    print('DOSTĘPNE SAMOCHODY UŻYWANE')
    print('==========================')

    # Wyświetlenie danych samochodu osobowego.
    print('W ofercie jest następujący samochód osobowy:')
    print('Marka:', car.get_make())
    print('Model:', car.get_model())
    print('Przebieg:', car.get_mileage())
    print('Cena:', car.get_price())
    print('Liczba drzwi:', car.get_doors())
    print()

    # Wyświetlenie danych samochodu terenowego.
    print('W ofercie jest następujący samochód terenowy:')
    print('Marka:', truck.get_make())
    print('Model:', truck.get_model())
    print('Przebieg:', truck.get_mileage())
    print('Cena:', truck.get_price())
    print('Drive type:', truck.get_drive_type())
    print()

    # Wyświetlenie danych samochodu typu SUV.
    print('W ofercie jest następujący samochód typu SUV:')
    print('Marka:', suv.get_make())
    print('Model:', suv.get_model())
    print('Przebieg:', suv.get_mileage())
    print('Cena:', suv.get_price())
    print('Passenger Capacity:', suv.get_pass_cap())
def main():
    # create a Car object for a used 2001 BMW
    # with 70,000 miles, priced at $15,000, with
    # 4 doors.
    car = vehicles.Car("BMW", 2001, 70000, 15000.0, 4)

    # create a Truck object for a used 2002
    # Toyota pickup with 40,000 miles, priced
    # at $12,000, with 4 wheel drive.
    truck = vehicles.Truck("Toyota", 2002, 40000, 12000.0, "4WD")

    # create an SUV object for a used 2002
    # Toyota pickup with 40,000 miles, priced
    # at $12,000, with 4-wheel drive.
    suv = vehicles.SUV("Volvo", 2000, 30000, 18500.0, 5)

    print("USED CAR INVENTORY")
    print("===================")

    # display the car's data
    print('The following car is in inventory:')
    print('Make:', car.get_make())
    print('Model:', car.get_model())
    print('Mileage:', car.get_mileage())
    print('Price:', car.get_price())
    print('Number of doors:', car.get_doors())
    print()

    # display the truck's data.
    print("The following pickup truck is in inventory.")
    print('Make:', truck.get_make())
    print('Model:', truck.get_model())
    print('Mileage:', truck.get_mileage())
    print('Price:', truck.get_price())
    print('Drive type:', truck.get_drive_type())
    print()

    # display the SUV's data.
    print("The following SUV is in inventory.")
    print('Make:', suv.get_make())
    print('Model:', suv.get_model())
    print('Mileage:', suv.get_mileage())
    print('Price:', suv.get_price())
    print('Passenger Capacity:', suv.get_pass_cap())
def main():
    # Create a Car object for a used 2001 BMW
    # with 70,000 miles, priced at $15,000, with
    # 4 doors.
    car = vehicles.Car('BMW', 2001, 70000, 15000.0, 4)

    # Create a Truck object for a used 2002
    # Toyota pickup with 40,000 miles, priced
    # at $12,000, with 4-wheel drive.
    truck = vehicles.Truck('Toyota', 2002, 40000, 12000.0, '4WD')

    # Create an SUV object for a used 2000
    # Volvo with 30,000 miles, priced
    # at $18,500, with 5 passenger capacity.
    suv = vehicles.SUV('Volvo', 2000, 30000, 18500.0, 5)

    print('USED CAR INVENTORY')
    print('===================')

    # Display the car's data.
    print('The following car is in inventory:')
    print('Make:', car.get_make())
    print('Model:', car.get_model())
    print('Mileage:', car.get_mileage())
    print('Price:', car.get_price())
    print('Number of doors:', car.get_doors())
    print()

    # Display the truck's data.
    print('The following pickup truck is in inventory.')
    print('Make:', truck.get_make())
    print('Model:', truck.get_model())
    print('Mileage:', truck.get_mileage())
    print('Price:', truck.get_price())
    print('Drive type:', truck.get_drive_type())
    print()

    # Display the SUV's data.
    print('The following SUV is in inventory.')
    print('Make:', suv.get_make())
    print('Model:', suv.get_model())
    print('Mileage:', suv.get_mileage())
    print('Price:', suv.get_price())
    print('Passenger Capacity:', suv.get_pass_cap())
Пример #10
0
def main():
    # Создать объект Car для подержанного авто 2001 BMW
    # с 70000 милями пробега, ценой $15000,
    # c 4 дверьми.
    car = vehicles.Car('BMW', 2001, 70000, 15000.0, 4)

    # Создать объект Truck для подержанного пикапа 2002
    # Toyota c 40000 милями пробега, ценой
    # $12000 и с 4-колесным приводом.
    truck = vehicles.Truck('Toyota', 2002, 40000, 12000.0, '4WD')

    # Создать объект SUV для поддержанного 2000
    # Volvo с 30000 милями пробега, ценой
    # $18500 и вместимостью 5 человек.
    suv = vehicles.SUV('Volvo', 2000, 30000, 18500.0, 5)

    print('ПОДЕРЖАННЫЕ АВТО НА СКЛАДЕ', "==========================", sep="\n")

    # Показать данные легкового авто.
    print('Данный легковой автомобиль имеется на складе:')
    print('Изготовитель:', car.get_make())
    print('Модель:', car.get_model())
    print('Пробег:', car.get_mileage())
    print('Цена:', car.get_price())
    print('Количество дверей:', car.get_doors())
    print()

    # Показать данные пикапа.
    print('Данный пикап имеется на складе:')
    print('Изготовитель:', truck.get_make())
    print('Модель:', truck.get_model())
    print('Пробег:', truck.get_mileage())
    print('Цена:', truck.get_price())
    print('Тип привода:', truck.get_drive_type())
    print()

    # Показать данные джипа.
    print('Данный джип имеется на складе:')
    print('Изготовитель:', suv.get_make())
    print('Модель:', suv.get_model())
    print('Пробег:', suv.get_mileage())
    print('Цена:', suv.get_price())
    print('Пассажирская вместимость:', suv.get_pass_cap())