def main():
    new_taxi = Taxi("Prius 1", 100)
    new_taxi.drive(40)
    print(new_taxi)
    new_taxi.start_fare()
    new_taxi.drive(100)
    print(new_taxi)
def main():
    taxi = Taxi("Prius 1", 100)
    taxi.drive(40)
    print(taxi)
    taxi.start_fare()
    taxi.drive(100)
    print(taxi)
def run_tests():
    """Run tests to show workings of Car and Taxi classes."""
    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)

    """drive bus (input/loop is oblivious to fuel)"""
    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 = SliverServiceTaxi("Limo", 100, 2)
    print(sst, sst.get_fare())
    sst.drive(10)
    print(sst, sst.get_fare())
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())
Exemple #5
0
def main():
    Prius = Taxi(100, "prius 1")
    Prius.drive(40)
    print(Prius)
    Prius.start_fare()
    Prius.drive(100)
    print(Prius)
Exemple #6
0
def main():
    my_taxi = Taxi("Prius 1", 100)
    my_taxi.drive(40)
    print(my_taxi)
    my_taxi.start_fare()
    my_taxi.drive(100)
    print(my_taxi)
Exemple #7
0
def main():
    """Code to test a taxi"""
    prius_one = Taxi("Pirus 1", 100)
    prius_one.drive(40)
    print(prius_one)
    prius_one.start_fare()
    prius_one.drive(100)
    print(prius_one)
Exemple #8
0
def main():
    """Test taxi (car subclass) features"""

    new_taxi = Taxi("Prius 1", 100)
    new_taxi.drive(40)
    print(new_taxi)
    new_taxi.start_fare()
    new_taxi.drive(100)
    print(new_taxi)
def Main():
    my_taxi = Taxi("Pruis 1", 100)
    my_taxi.drive(40)
    print(my_taxi)
    print(my_taxi.get_fare)
    my_taxi.start_fare()
    my_taxi.drive(100)
    print(my_taxi)
    print(my_taxi.get_fare)
def main():
    prius = Taxi('Prius', 100)
    prius.drive(40)
    print(prius)
    print("The current fair is ${}".format(prius.get_fare()))
    prius.start_fare()
    prius.drive(100)
    print(prius)
    print("The current fair is ${}".format(prius.get_fare()))
def main():
    my_taxi = Taxi("Prius 1", 100, 1.23)
    my_taxi.drive(40)
    print(my_taxi)
    print(my_taxi.get_fare())
    taxi = Taxi("Prius 1", 100, 1.23)
    taxi.drive(100)
    print(my_taxi.start_fare())
    print(taxi.get_fare())
Exemple #12
0
def main():
    """Test Taxi class."""
    taxi1 = Taxi("Prius 1", 100)
    taxi1.drive(40)
    print(taxi1)

    taxi1.start_fare()  # start a new fare
    taxi1.drive(100)
    print(taxi1)
Exemple #13
0
def main():
    """Test Taxi class."""
    my_taxi = Taxi("Prius", 100)
    my_taxi.drive(40)
    print(my_taxi)
    my_taxi.start_fare()
    my_taxi.drive(40)
    print(my_taxi)
    print("Total cost of trip ${:.2f}".format(my_taxi.get_fare()))
Exemple #14
0
def main():
    taxi1 = Taxi("Prius 1", 100, 1.23)
    taxi1.drive(40)
    print(taxi1)
    print("The current fare is ${}".format(taxi1.get_fare()))
    taxi1.start_fare()
    taxi1.drive(100)
    print(taxi1)
    print("The current fare is ${}".format(taxi1.get_fare()))
def main():
    """Test Taxi class."""
    my_taxi = Taxi("Prius 1", 100)
    my_taxi.drive(40)
    print(my_taxi)
    my_taxi.start_fare()
    my_taxi.drive(100)
    print(my_taxi)

    print(Taxi.price_per_km)
def main():
    my_taxi = Taxi("Prius 1", 100)
    my_taxi.drive(40)
    print("Taxi name: {}, Current Fuel {} and Current Fare is ${}".format(
        my_taxi.name, my_taxi.fuel, my_taxi.get_fare()))

    my_taxi.start_fare()
    my_taxi.drive(100)
    print("Taxi name: {}, Current Fuel {} and Current Fare is ${}".format(
        my_taxi.name, my_taxi.fuel, my_taxi.get_fare()))
Exemple #17
0
def main():
    my_taxi = Taxi('Prius 1', 100)
    my_taxi.drive(40)
    print("Taxi = {}".format(my_taxi.name))
    print("Current fare = ${:.2f}".format(my_taxi.get_fare()))
    my_taxi.start_fare()
    my_taxi.drive(100)
    print("Taxi = {}".format(my_taxi.name))
    print("Current fare = ${:.2f}".format(my_taxi.get_fare()))
    print(Taxi.price_per_km)
Exemple #18
0
def main():
    my_taxi = Taxi('Prius 1', 100, 1.23)
    my_taxi.drive(40)
    print(my_taxi)
    print('Taxi Details:{}, current fare:${}'.format(
        my_taxi.name, my_taxi.current_fare_distance))
    my_taxi.start_fare()
    my_taxi.drive(100)
    print('Taxi Details:{}, current fare:${}'.format(
        my_taxi.name, my_taxi.current_fare_distance))
    print(my_taxi)
Exemple #19
0
from Prac_08.car import Car
from Prac_08.taxi import Taxi

Prius1 = Taxi("Prius 1", 100)
Prius1.drive(40)
print(Prius1)
Prius1.start_fare()
Prius1.drive(100)
print(Prius1)
Exemple #20
0
from Prac_08.taxi import Taxi

taxi_1 = Taxi("Prius 1", 100)
taxi_1.drive(40)
print(taxi_1)
print("Fare = ${}".format(taxi_1.get_fare()))
taxi_1.start_fare()
taxi_1.drive(100)
print(taxi_1)
print("Fare = ${}".format(taxi_1.get_fare()))
Exemple #21
0
from Prac_08.taxi import Taxi

# Create a new taxi with name "Prius 1", 100 units of fuel and price of $1.23/km
new_taxi = Taxi("Prius 1", 100)

# Drive the taxi 40km
new_taxi.drive(40)

# Print the taxi's details and the current fare
print(new_taxi)

# Restart the meter (start a new fare) and then drive the car 100km
new_taxi.start_fare()
new_taxi.drive(100)

# Print the details and the current fare
print(new_taxi)
Exemple #22
0
from Prac_08.taxi import Taxi

NewTaxi = Taxi("Prius1", 100)
NewTaxi.drive(20)
print(NewTaxi)
print(NewTaxi.get_fare())
NewTaxi.start_fare()
NewTaxi.drive(40)
print(NewTaxi)
print(NewTaxi.get_fare())