Skip to content

array lab #219

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
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
39 changes: 25 additions & 14 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,7 +23,7 @@
*/
// write your code here


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



Expand All @@ -32,7 +32,7 @@
*/
// write your code here


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



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



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



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



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



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



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



Expand All @@ -74,7 +73,8 @@
*/
// write your code here


var itemToPrint = shoppingList[1]
print(itemToPrint)



Expand All @@ -86,9 +86,9 @@
*/
// write your code here

futureShoppingList[2] = "Chicken"



print(futureShoppingList)



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


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



Expand All @@ -109,8 +119,8 @@
// write your code here




var result = lifeEssentials(ingredients: shoppingList)
print (result)



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

var result2 = lifeEssentials(ingredients: desertList)
print(result2)



Expand Down