diff --git a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift index c1f926f..1e6c260 100644 --- a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift +++ b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift @@ -13,8 +13,11 @@ /*: question1 ### 1. Create a function that will take in a continent and the number of countries in that continent. It should print the following sentence "____ is a continent which contains ___ countries". */ -// write your code here +func continentFunc(continent: String, countries: Int){ + print("\(continent) is a continent which contains \(countries) countries") +} +continentFunc(continent: "North America", countries: 2) @@ -25,7 +28,7 @@ func greeting(name: String, greeting: String) { print("\(greeting), \(name)!") } -greeting(name: "Danny", "Hello") +greeting(name: "Danny",greeting: "Hello") @@ -33,7 +36,7 @@ greeting(name: "Danny", "Hello") /*: question3 ### 3. This function doesn't work, either. Can you fix the function (_not_ the call) so that it works? */ -func daysInMonth(month: String, days: String) { +func daysInMonth(month: String, days: Int) { print("There are \(days) in \(month)") } @@ -45,9 +48,11 @@ daysInMonth(month: "November", days: 30) /*: question4 ### 4. So far, you have created functions that take two arguments. Can you create (and call) one that takes three? Try to create a function that three parameters: a beverage, the number of bottles of that beverage, and a place you can keep those bottles. Print the sentence "____ bottles of ____ on the ____ wall." */ -// write your code here - +func bottleFunc(_ beverage: String, _ bottles: Int, _ place: String){ + print("\(bottles) bottles of \(beverage) on the \(place) wall.") + } +bottleFunc("Whiskey", 22, "Kitchen") //: Click [here](https://github.com/learn-co-curriculum/swift-funcMultipleArg-lab/blob/solution/MyPlayground.playground/Pages/solution.xcplaygroundpage/Contents.swift) to see the solution. diff --git a/MyPlayground.playground/Pages/main.xcplaygroundpage/timeline.xctimeline b/MyPlayground.playground/Pages/main.xcplaygroundpage/timeline.xctimeline new file mode 100644 index 0000000..bf468af --- /dev/null +++ b/MyPlayground.playground/Pages/main.xcplaygroundpage/timeline.xctimeline @@ -0,0 +1,6 @@ + + + + +