''' CS5001 Fall 2018 Classes & Objects Sample code -- make two coffee objects, passing reqd/optional parameters call the add-on method as a example to see the price changing. And then make a *bunch* of coffees in a loop, print them all out ''' from coffee import Coffee import random def main(): my_coffee = Coffee("L", 2.35) my_coffee.name = "Black Coffee" your_coffee = Coffee("L") your_coffee.price = 2.99 your_coffee.name = "Black Coffee" your_coffee.add_on("shot") third_coffee = Coffee("S", 2.13, False) print("I ordered", my_coffee) if your_coffee == my_coffee: print("Our coffees are the same!") else: print("Our coffees are totally different") print("\n...Now let's make a bunch of coffees, get ready everyone!\n") coffees = [] names = ["Black Coffee", "Latte", "Cider"] add_ons = ["shot", "flavor", ""] sizes = ["S", "M", "L"] for i in range(20): coffee = Coffee(random.choice(sizes)) coffee.name = random.choice(names) coffee.add_on(random.choice(add_ons)) coffees.append(coffee) for coffee in coffees: print(coffee, "\n") main()