Example #1
0
def run_tests():
    bus = Car("Datsun", 180)
    bus.drive(30)
    print("fuel =", bus.fuel)
    print("odo =", bus.odometer)
    bus.drive(55)
    print("fuel =", bus.fuel)
    print("odo = ", bus.odometer)
    print(bus)

    distance = int(input("Drive how far? "))
    while distance > 0:
        travelled = bus.drive(distance)
        print("{} travelled {}".format(str(bus), travelled))
        distance = int(input("Drive how far? "))

    t = Taxi("Prius 1", 100)
    print(t)
    t.drive(25)
    print(t, t.get_fare())
    t.start_fare()
    t.drive(40)
    print(t, t.get_fare())

    sst = SilverServiceTaxi("Limo", 100, 2)
    print(sst, sst.get_fare())
    sst.drive(10)
    print(sst, sst.get_fare())
Example #2
0
def main():
    silvertaxi = SilverServiceTaxi("SST1", 200, 2)
    print(silvertaxi)

    silvertaxi.drive(18)
    print(silvertaxi)
    print("The current fare is {:.2f}".format(silvertaxi.get_fare()))
    silvertaxi.start_fare()
def main():
    # car_type = input("Car Type")
    # car_fuel = int(input("How Much Fuel Do We Have?"))
    # car_fanciness = int(input("How Fancy is the car?"))
    # taxi = SilverServiceTaxi(car_type, car_fuel, car_fanciness)
    taxi = SilverServiceTaxi("Hummer", 100, 2)
    taxi.drive(18)
    print(taxi)
    print(taxi.get_fare())
Example #4
0
def main():
    """Test taxi (car subclass) features"""

    new_fancy_taxi = SilverServiceTaxi("Hummer", 100, 2)
    new_fancy_taxi.drive(18)
    print(new_fancy_taxi.get_fare())
    print(new_fancy_taxi)
    new_fancy_taxi.start_fare()
    new_fancy_taxi.drive(100)
    print(new_fancy_taxi)
def main():
    my_silverservice = SilverServiceTaxi('Hummer', 200, 4)
    print(my_silverservice)
    my_silverservice.start_fare()
    my_silverservice.drive(100)
    print(my_silverservice.get_fare())
    print(my_silverservice)

    test_silverservice = SilverServiceTaxi('Lotus', 100, 2)
    print(test_silverservice)
    test_silverservice.start_fare()
    test_silverservice.drive(18)
    print(test_silverservice.get_fare())
    print(test_silverservice)
Example #6
0
def main():
    my_taxi = SilverServiceTaxi("Hummer", 200, 4)
    my_taxi.drive(49)
    print(my_taxi)
    print("${}".format(my_taxi.get_fare()))
Example #7
0
from Prac_08.silver_service_taxi import SilverServiceTaxi

taxi_1 = SilverServiceTaxi("Hummer", 200, 4)
print(taxi_1)
taxi_2 = SilverServiceTaxi("My Taxi", 1000, 2)
print(taxi_2.drive(18))
print("Fare = ${:.2f}".format(taxi_2.get_fare()))
def main():
    taxi = SilverServiceTaxi("Silver Service Taxi", 100, 2)
    taxi.drive(18)
    print(taxi)
    print(taxi.get_fare())
Example #9
0
def main():
    """Test SilverServiceTaxi."""
    taxi = SilverServiceTaxi("Taxi F", 100, 3)
    taxi.drive(50)
    print(taxi)
    print("The total fare is $", taxi.get_fare())
Example #10
0
from Prac_08.silver_service_taxi import SilverServiceTaxi

# For an 18km trip in a SilverServiceTaxi with fanciness of 2, the fare should be $48.78 (yikes!)

premium_taxi = SilverServiceTaxi("Premium Taxi", 200, 2)
print(premium_taxi)
premium_taxi.drive(18)
print(premium_taxi.get_fare())
print(premium_taxi)
Example #11
0
def main():
    """Test SilverServiceTaxi."""
    taxi = SilverServiceTaxi("Test Fancy Taxi", 100, 2)
    taxi.drive(18)
    print(taxi)
    print(taxi.get_fare())
Example #12
0
from Prac_08.silver_service_taxi import SilverServiceTaxi

new_ride = SilverServiceTaxi("Hummer", 100, 2)
new_ride.start_fare()
new_ride.drive(18)
new_ride.get_fare()
print(new_ride.__str__())
print(new_ride.get_fare())
from Prac_08.silver_service_taxi import SilverServiceTaxi

new_silver_taxi = SilverServiceTaxi("Silver Boi", 100, 2)
new_silver_taxi.drive(18)
print(new_silver_taxi)
print(new_silver_taxi.get_fare())
def main():
    limo_taxi = SilverServiceTaxi('Limo', 200, 2)
    print(limo_taxi)
    limo_taxi.drive(18)
    print(limo_taxi)
    print("Current Fare: $", limo_taxi.get_fare())
from Prac_08.silver_service_taxi import SilverServiceTaxi

new_taxi = SilverServiceTaxi("Hummer", 50, 2)
new_taxi.drive(55)
print(new_taxi, new_taxi.get_fare())


Example #16
0
def main():
    silver_taxi = SilverServiceTaxi(100, "Silver", 2)
    print(silver_taxi)
    silver_taxi.drive(18)
    print(silver_taxi)