From 395ac497c83c3ce065a75467a9f90e53fab9c8ea Mon Sep 17 00:00:00 2001 From: astruckm Date: Fri, 7 Apr 2017 13:01:54 -0400 Subject: [PATCH 1/3] Complete first Playground lab --- .../main.xcplaygroundpage/Contents.swift | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift index ebe55fd..2ee0bcb 100644 --- a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift +++ b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift @@ -14,47 +14,43 @@ /*: question1 ### 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 myBalance = 0 /*: question2 ### 2. You went to your local pet store and purchased yourself a puppy. You decided to name the puppy Bella. Once you named her, that name will stick with her forever. Create a variable that stores the name of your new puppy. */ -// write your code here - +let puppyName = "Bella" /*: question3 ### 3. Use the `print()` function to print the name of your new puppy to the console. */ -// write your code here - +print("\(puppyName)") /*: question4 ### 4. Use the `print()` function to print the sentence "I just got a new puppy named and she is awesome!" to the console. */ -// write your code here - +print("I just got a new puppy 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 $\(myBalance) in my bank account.") /*: question6 ### 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 +myBalance = 100 +print("I now have $\(myBalance).") @@ -62,8 +58,11 @@ /*: question7 ### 7. You decided you don't like the name Bella. Change your puppy's name to something else. (Can you do this? What happens when you try? Why?) */ -// write your code here +// tried entering the following code: +//myPuppy = "Chewy" +//Got error messages +//You cannot do this because the puppy's name, myPuppy, is a constant, so it is immutable. /*: 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. From 1305ae42db93a80744c83a297c767c6ccbc1da54 Mon Sep 17 00:00:00 2001 From: astruckm Date: Sun, 9 Apr 2017 18:42:09 -0400 Subject: [PATCH 2/3] 2nd attempt at getting this one pulled --- .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..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Sun, 9 Apr 2017 18:51:33 -0400 Subject: [PATCH 3/3] 3rd attempt --- .DS_Store | Bin 6148 -> 6148 bytes .../main.xcplaygroundpage/Contents.swift | 1 + 2 files changed, 1 insertion(+) diff --git a/.DS_Store b/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..7b8aaff8eb20c3ee00d01100452ac8447819d103 100644 GIT binary patch literal 6148 zcmeHK!AiqG5Pe&FsECl89`_3h1wUXZ@hAvAc@QcMRIo8Y%%QjZr2pfaow2k;5A`6T zGcfZulbK2OEo3qP!n~_yKmlMv6&#(?d?IpRbRZ-1jEN!Fc)%8Gyr4lhh<3+sWI)dD z0yjLjTWqj@e$S{dMLYCv*0aT`saxI7^zQfybyJpA_qqb!il?hw=g4=co9d&&`S$)h z723!BT`Y46H_m`F;0*i|2H3MjCTEInodIXS8Q3u(--k#QOoqK;{&djf5r8Paky*Hw zSweE6VKVF$d501-m8hw~MvS28^hb+JhP|SuBiQf}?8(6WK(*Li&p8pS%{K^?{2L2QSVO%cCIk#lJb+9?AjHu~2NHo+1YW5HK<@2y9kle#WxdfcX^DW_AvK4xj>{$am(+{342+ UKzW7)kiy9(Jj$D6L{=~Z02rPQkN^Mx diff --git a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift index d5047e1..559f2b1 100644 --- a/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift +++ b/MyPlayground.playground/Pages/main.xcplaygroundpage/Contents.swift @@ -51,6 +51,7 @@ print("I have $\(myBalance) in my bank account.") */ myBalance = 100 print("I now have $\(myBalance).") +//Something something