13 lines
285 B
Ruby
13 lines
285 B
Ruby
def order_soda(flavor, size = "medium", quantity = 1)
|
|
if quantity == 1
|
|
plural = "soda"
|
|
else
|
|
plural = "sodas"
|
|
end
|
|
puts "#{quantity} #{size} #{flavor} #{plural}!"
|
|
end
|
|
|
|
|
|
order_soda("orange")
|
|
order_soda("lemon-lime", "small", 2)
|
|
order_soda("grape", "large") |