From 5611bfeb41e0389fa7d7654f091e8b643cd8341d Mon Sep 17 00:00:00 2001 From: pmaurelia Date: Thu, 7 Feb 2019 15:25:41 -0500 Subject: [PATCH] arrayChallenge Quiz --- .DS_Store | Bin 0 -> 6148 bytes ArrayChallenge.xcodeproj/project.pbxproj | 15 +++++++++++++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ ArrayChallenge/.DS_Store | Bin 0 -> 6148 bytes ArrayChallenge/ShoppingList.swift | 17 ++++++++++------- 5 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 .DS_Store create mode 100644 ArrayChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ArrayChallenge/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8967da0ba714e55efb2d5b6843a5af578fef6618 GIT binary patch literal 6148 zcmeHK%Wl&^6upy#Vz;7=1X9b+8zdGHN~D%jp-LfXgd*`04zK`}+O^dfxt=I?2qgq% z!%x5$@GERs@*#WxoOys6rwu!V=v-^&%;TQx+!K4oLqx1G3~EGWBC=2fmX=YSVq#vD zIVutf83l|2|GEO=-Cdukybj`|lus-i*-g+N;BG1PX0s{o=D6sdOVdxdwQ?@AH%S`>i~@@k5bJ}3 zBCxJ;s!%Q+sN@j + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ArrayChallenge/.DS_Store b/ArrayChallenge/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6af19dfe9ab4379e6c89fcb1771c226f08454ac1 GIT binary patch literal 6148 zcmeHKu};G<5PerFRA8VWBp5R?Au+RrQie)wm6&NEl%lAq+9DXU@G*QJ9{}%sR#6kW z0z!9@{hZ6av;7>!F#zd2-JJq$04)~9#ulq@OrLA1StEKji4t;T$dO@$0T#7rcl<>K zbnW(Vjw!D$*Y0cmGMr$JXN+-=MK3RIhj}q%w7x25EXNuN07Gx8Ln>N^x(k xO-}dPgyn`sP2)<#C54T!6*E@1;v<$|^e5UNrV&d+dT9P55M=Pm75GsFJ^^8?Ysmlr literal 0 HcmV?d00001 diff --git a/ArrayChallenge/ShoppingList.swift b/ArrayChallenge/ShoppingList.swift index 646e1db..e0202d1 100644 --- a/ArrayChallenge/ShoppingList.swift +++ b/ArrayChallenge/ShoppingList.swift @@ -10,13 +10,16 @@ class ShoppingList { - func createShoppingList(withItems items: [String], amountOfEachItem amounts: [String]) -> [String] { - - - // Implement this function - - + func createShoppingList(withItems items: [String], amountOfEachItem amounts: [String]) -> [String] + { + var combinedList: [String] = [] + for (index,item) in items.enumerated() + { + let amount = amounts[index] + let combinedItem = "\(index + 1). \(item)(\(amount))" + combinedList.append(combinedItem) + } + return combinedList } - }