Created
October 24, 2015 04:56
-
-
Save takaheraw/cd6306b04b3c159956ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Burger { | |
let customerName:String | |
let veggieProduct:Bool | |
let patties:Int | |
let pickles:Bool | |
let mayo:Bool | |
let ketchup:Bool | |
let lettuce:Bool | |
let cook:Cooked | |
enum Cooked : String { | |
case RARE = "Rare" | |
case NORMAL = "Normal" | |
case WELLDONE = "Well Done" | |
} | |
init(name:String, veggie:Bool, patties:Int, pickles:Bool, mayo:Bool, ketchup:Bool, lettuce:Bool, cook:Cooked) { | |
self.customerName = name | |
self.veggieProduct = veggie | |
self.patties = patties | |
self.pickles = pickles | |
self.mayo = mayo | |
self.ketchup = ketchup | |
self.lettuce = lettuce | |
self.cook = cook | |
} | |
func printDescription() { | |
print("Name: \(self.customerName)") | |
print("Veggie: \(self.veggieProduct)") | |
print("Patties: \(self.patties)") | |
print("Pickles: \(self.pickles)") | |
print("Mayo: \(self.mayo)") | |
print("Ketchup: \(self.ketchup)") | |
print("Lettuce: \(self.lettuce)") | |
print("Cook: \(self.cook.rawValue)") | |
} | |
} | |
let order = Burger(name: "Joe", veggie: false, patties: 2, pickles: true, mayo: true, ketchup: true, lettuce: true, cook: Burger.Cooked.NORMAL) | |
order.printDescription() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment