From 58b26cbeff479bb805af59e59c60b7fec3221a06 Mon Sep 17 00:00:00 2001 From: calebui Date: Thu, 1 Nov 2018 13:45:40 -0700 Subject: [PATCH 1/2] Solution to a task --- .../Pages/main.xcplaygroundpage/Contents.swift | 14 +++++++------- MyPlayground.playground/contents.xcplayground | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift index ebe55fd..9698a1f 100644 --- a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift +++ b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift @@ -15,8 +15,7 @@ ### 1. Create a variable which represents your bank account balance. (For example: What is a good name for this variable that makes it easily readable for myself now and for the future me _or_ other developers I might be working with? Should I declare it using `let` or `var`? Should it be of type `Int` or `String`?) */ // write your code here - - +var bankAccountBalance: Int = 2000 /*: question2 @@ -24,6 +23,7 @@ */ // write your code here +var puppyName: String = "Bella" @@ -31,7 +31,7 @@ ### 3. Use the `print()` function to print the name of your new puppy to the console. */ // write your code here - +print(puppyName) @@ -40,14 +40,14 @@ */ // write your code here - +print("I just got a new pubby named \(puppyName) and she is awesome!") /*: question5 ### 5. Use the `print()` function to print the sentence "I have $ in my bank account." to the console. */ // write your code here - +print("I have \(bankAccountBalance) in my bank account") @@ -55,7 +55,7 @@ ### 6. Congratulations! You just got $100 for your birthday, so now you have $100 more in your bank account. Update your bank account with the new balance and print "I now have $." to the console. */ // write your code here - +print("I now have \(bankAccountBalance + 100)") @@ -64,7 +64,7 @@ */ // write your code here - +var puppyName: String = "Cutie" //Can't redeclaration of a variable /*: Checkout the solution branch - git co solution or git checkout solution and then scroll back down to this very spot to see a link that directs you to the solutions to the above questions. diff --git a/MyPlayground.playground/contents.xcplayground b/MyPlayground.playground/contents.xcplayground index 5ed2911..ddbb3ee 100644 --- a/MyPlayground.playground/contents.xcplayground +++ b/MyPlayground.playground/contents.xcplayground @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file From 8166538ae523ad4f7dbaa3653b0ef84a7e310078 Mon Sep 17 00:00:00 2001 From: calebui Date: Thu, 1 Nov 2018 13:59:45 -0700 Subject: [PATCH 2/2] Correcting the last solution --- .DS_Store | Bin 0 -> 6148 bytes .../Pages/main.xcplaygroundpage/Contents.swift | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..64c7d37ee9c7025e5b3968883f33f29b2493e0d4 GIT binary patch literal 6148 zcmeHKOG?B*5PdZUjkuYey6Xd|I5&txTnfTmK*!)HWK0mVaF?UGaVvTwUv)RbG*Q8g zh*m-M>(r;a^Ab`i05a{W2`~nbQx!+s96k{Bs}5uoEt^EqHR{D=cGWD~L8KXeD+BuM zG8|!nTRbGsPqKq`-?AyodELxu%e(#Sx0mOqlhj{*>2Gh=-i@tSreYUoc*HqsToMAm>2`bfHCk-8DPy;$#(+UXbczw#=wdJ{XRIVViBu#q!L4_#1=zBI_)mT6%qS@AsrH%4~aWV>`=t- z&h?!ShZF&AGzN@;l!1+KIoA4r`g#AKCfSuSU<~{z1|%zI<&?J+YwO_VwAMQ61yx1k m`hcqxPJAh5td`