Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Restaurant
- def initialize(menu)
- @menu = menu
- end
- def cost(*orders)
- costs = 0
- orders.each do |order|
- if @menu.key == order[0]
- costs = costs + order[1] * @menu[order]
- end
- end
- return costs
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment