Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Coffee {
- case Americano, Esepresso, CaffeLatte, CaffeMocha
- func recipe() {
- switch self {
- case Americano:
- println("에스프레소 1 + 뜨거운 물 3")
- case Esepresso:
- println("에스프레소 1")
- case CaffeLatte:
- println("에스프레소 1 + 우유 3")
- case CaffeMocha:
- println("에스프레소 1 + 우유 3 + 초코소스 1")
- default:
- println("만드는 방법을 추가해주세요.")
- }
- }
- }
- let order = Coffee.CaffeLatte
- order.recipe()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement