def main(): service_dict = {} name = input("Enter customer name: ") address = input("Enter Address: ") phone = input("Enter customer phone: ") customer_info = CustomerClass.Customer(name, address, phone) make = input(" car make: ") model = input("car model: ") year = input("car year: ") car_info = CarClass.Car(make, model, year) pcharges = int(input("parts charges: ")) lcharges = int(input("labor charges: ")) taxrate = float(input("Enter salestax rate: ")) service_quote = ServiceQuoteClass.ServiceQuote(pcharges, lcharges, taxrate) service_dict[customer_info.get_name()] = [ customer_info.get_address(), customer_info.get_phone(), car_info.get_make(), car_info.get_model(), car_info.get_year(), service_quote.get_lcharges(), service_quote.get_pcharges(), service_quote.get_salestax(), service_quote.get_totalcharges(), ] print("Tax charges: ", (service_quote.get_salestax())) print("Total charges: ", (service_quote.get_totalcharges()))
def main(): # Initialize the year and make of the car year = "1994" make = "Audi" # Create an object of the Car class car = cc.Car(year, make) print("Car Speedometer") print("-------------") # Accelerate the car 5 times for speed in range(5): # Call the accelerate() method car.accelerate() # Display the current speed as car accelerates print("Car Speed at:", car.get_speed(), "miles/hr") # Display the total speed reached print("-----------------------------") print("The total speed reached is:", car.get_speed(), "miles/hr") print("-----------------------------") print("Car decelerating.......... ") print() # Decelerate the car 5 times for speed in range(5): # Call the brake() method car.brake() # Display the current speed as car decelerates print("Car decelerated to:", car.get_speed(), "miles/hr")
def car_info(): print("Hello! Please input your vehicle's information below.") year_model = input( "What is your vehicle's YEAR and MODEL? (Format: 'YYYY, MODEL') ") make = input("What is your vehicle's MAKE? ") speed = 0 car_info = cc.Car(year_model, make, speed) car_speed_montoring(year_model, make, speed, car_info)
def main(): lightningMcqueen = c.Car(2012, "rdx") for i in range(5): lightningMcqueen.accelerate() print("Speed is " + str(lightningMcqueen.getSpeed()) + " mph") for i in range(5): lightningMcqueen.brake() print("Speed is " + str(lightningMcqueen.getSpeed()) + " mph")
def main(): my_car = c1.Car(2020, "Ford") for i in range(5): my_car.accelerate() print( "Acceleration ", i + 1, ", the new speed is: ", my_car.get_speed(), sep="" ) for i in range(5): my_car.brake() print("Brake ", i + 1, ", the new speed is: ", my_car.get_speed(), sep="")
def main(): my_car = c.Car(2019, "Toyota") for x in range(5): my_car.accelerate() print("Current accelerating speed is", my_car.get_speed()) print() for x in range(5): my_car.brake() print("Current braking speed is", my_car.get_speed())
def main(): import CarClass as c myCar = c.Car("1990 Honda", "Civic") print("Accelerating 5 times") for i in range(5): myCar.accelerate() print(myCar.get_speed(myCar)) print("Decelerating 5 times") for i in range(5): myCar.brake() print(myCar.get_speed(myCar))
def main(): # Prompt for the year model and make year_model = input('Enter the Year/Model of the vehicle: ') make = input('Enter the make of the vehicle: ') # create the Car class object auto = car.Car(year_model, make) # call the accelerate method 5x for _ in range(5): auto.accelerate() print('Current speed is', auto.get_speed()) # call the brake method 5x for _ in range(5): auto.brake() print('Current speed is', auto.get_speed())
def main(): year_model = input("Enter the car's model year. ") make = input("Enter the car's make. ") car = CarClass.Car(year_model, make) acc_count = 1 while acc_count <= 5: car.accelerate() print(car.get_speed()) acc_count += 1 brake_count = 1 while brake_count <= 5: car.brake() print(car.get_speed()) brake_count += 1
import CarClass as c Car = c.Car(2018, "Chevy") Car.get_speed() for i in range(5): Car.accelerate() Car.get_speed() for i in range(5): Car.brake() Car.get_speed()
import CarClass as c Ferarri = c.Car(2020, "California") for n in range(1, 6): Ferarri.accelerate() print("The car is moving", Ferarri.get_speed(), "mph") for k in range(1, 6): Ferarri.brake() print("The car is moving", Ferarri.get_speed(), "mph")