Skip to content

Add files via upload #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
// write your code here


var list = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



Expand All @@ -23,15 +23,17 @@
*/
// write your code here


var shoppingList: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



/*: question3
### 3. Initialize an array called 'futureShoppingList' **with** a type specified and then add the string values "Bread", "Butter", "Cheese", "Lettuce", "Tomatoes".
*/
// write your code here
var futureShoppingList: [String]

futureShoppingList = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



Expand All @@ -42,6 +44,7 @@
*/
// write your code here

let cheeseSandwich: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



Expand All @@ -51,7 +54,7 @@
### 5. Create a second array called 'dessertList' with a type specified which contains the string values "Cookie dough", "Icecream"
*/
// write your code here

var dessertList: [String] = ["Cookie dough", "Icecream"]



Expand All @@ -62,8 +65,7 @@
*/
// write your code here



var afternoonAttendance: [Int] = [2, 10, 3, 15, 7]



Expand All @@ -75,6 +77,8 @@
// write your code here


var itemToPrint = shoppingList[1]
print(itemToPrint)



Expand All @@ -87,7 +91,8 @@
// write your code here



futureShoppingList[2] = "Chicken"
print(futureShoppingList)



Expand All @@ -98,7 +103,13 @@
*/
// write your code here


func lifesEssential(ingredients: Array<String>) -> Bool {
if ingredients[0] == "Bread" {
return true
} else {
return false
}
}



Expand All @@ -109,7 +120,7 @@
// write your code here



print(lifesEssential(ingredients: shoppingList))



Expand All @@ -119,7 +130,7 @@
### 11. Pass the 'desertList' array to the 'lifesEssential' function and print the result.
*/
// write your code here

print(lifesEssential(ingredients: dessertList))



Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.