Skip to content

arrayChallenge Quiz #207

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
Binary file added .DS_Store
Binary file not shown.
15 changes: 13 additions & 2 deletions ArrayChallenge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@
TargetAttributes = {
5B9D1C7A1D0B31E500522058 = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = M4ZK8M3GMN;
LastSwiftMigration = 0800;
};
5B9D1C8E1D0B31E500522058 = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = M4ZK8M3GMN;
LastSwiftMigration = 0800;
TestTargetID = 5B9D1C7A1D0B31E500522058;
};
Expand Down Expand Up @@ -280,6 +282,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: pmaurelia@hotmail.com (TM297H4SUG)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
Expand Down Expand Up @@ -325,6 +328,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: pmaurelia@hotmail.com (TM297H4SUG)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
Expand All @@ -350,9 +354,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = M4ZK8M3GMN;
INFOPLIST_FILE = ArrayChallenge/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.flatironSchool.ArrayChallenge;
PRODUCT_BUNDLE_IDENTIFIER = com.pablo.ArrayChallenge;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
Expand All @@ -363,9 +368,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = M4ZK8M3GMN;
INFOPLIST_FILE = ArrayChallenge/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.flatironSchool.ArrayChallenge;
PRODUCT_BUNDLE_IDENTIFIER = com.pablo.ArrayChallenge;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
Expand All @@ -375,6 +381,9 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "iPhone Developer: pmaurelia@hotmail.com (TM297H4SUG)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: pmaurelia@hotmail.com (TM297H4SUG)";
DEVELOPMENT_TEAM = M4ZK8M3GMN;
INFOPLIST_FILE = ArrayChallengeTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.flatironSchool.ArrayChallengeTests;
Expand All @@ -388,6 +397,8 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "iPhone Developer: pmaurelia@hotmail.com (TM297H4SUG)";
DEVELOPMENT_TEAM = M4ZK8M3GMN;
INFOPLIST_FILE = ArrayChallengeTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.flatironSchool.ArrayChallengeTests;
Expand Down
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 added ArrayChallenge/.DS_Store
Binary file not shown.
17 changes: 10 additions & 7 deletions ArrayChallenge/ShoppingList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}