From 6347256f3bb6b577fbd2095890cee598f24e1abc Mon Sep 17 00:00:00 2001 From: Bushra alatwi Date: Wed, 6 Oct 2021 08:40:26 +0300 Subject: [PATCH] home work --- .../Contents.swift | 10 +++++++ .../Comments.xcplaygroundpage/Contents.swift | 3 ++ .../Errors.xcplaygroundpage/Contents.swift | 1 + .../Contents.swift | 0 .../Resources/playground-logo.pdf | Bin .../Contents.swift | 4 ++- .../Contents.swift | 0 .../Wrapup.xcplaygroundpage/Contents.swift | 0 .../contents.xcplayground | 0 .../Contents.swift | 10 +++++++ .../Contents.swift | 6 ++++ .../Contents.swift | 9 +++--- .../Contents.swift | 18 ++++++++++-- .../Contents.swift | 20 ++++++++++---- .../Contents.swift | 3 ++ .../Contents.swift | 11 ++++++++ .../Contents.swift | 8 ++++++ .../Contents.swift | 11 ++++++++ .../Contents.swift | 8 ++++++ .../Contents.swift | 3 ++ .../Contents.swift | 26 ++++++++++++++++++ .../Contents.swift | 23 ++++------------ .../Contents.swift | 7 +++++ .../Contents.swift | 11 ++++++++ .../Contents.swift | 14 ++++++++++ .../Contents.swift | 4 +++ 26 files changed, 181 insertions(+), 29 deletions(-) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/Calculations.xcplaygroundpage/Contents.swift (93%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/Comments.xcplaygroundpage/Contents.swift (97%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/Errors.xcplaygroundpage/Contents.swift (99%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/Introduction.xcplaygroundpage/Contents.swift (100%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/Introduction.xcplaygroundpage/Resources/playground-logo.pdf (100%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift (98%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/When Things Go Wrong.xcplaygroundpage/Contents.swift (100%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/Pages/Wrapup.xcplaygroundpage/Contents.swift (100%) rename 01 Playground Basics/{PlaygroundBasics.playground => 01 Playground Basics.playground}/contents.xcplayground (100%) diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/Calculations.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/Calculations.xcplaygroundpage/Contents.swift similarity index 93% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/Calculations.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/Calculations.xcplaygroundpage/Contents.swift index d097c36..933cf1e 100644 --- a/01 Playground Basics/PlaygroundBasics.playground/Pages/Calculations.xcplaygroundpage/Contents.swift +++ b/01 Playground Basics/01 Playground Basics.playground/Pages/Calculations.xcplaygroundpage/Contents.swift @@ -20,3 +20,13 @@ //: Next, learn how programmers can leave notes in code. //: //:[Previous](@previous) | page 3 of 7 | [Next: Comments](@next) +44 + 22 + 11 + +500 - 100 + +1 * 6 + +25 / 5 + + +(100 + 200 + 100)/2 diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/Comments.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/Comments.xcplaygroundpage/Contents.swift similarity index 97% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/Comments.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/Comments.xcplaygroundpage/Contents.swift index 2c29e92..5bc4b8f 100644 --- a/01 Playground Basics/PlaygroundBasics.playground/Pages/Comments.xcplaygroundpage/Contents.swift +++ b/01 Playground Basics/01 Playground Basics.playground/Pages/Comments.xcplaygroundpage/Contents.swift @@ -19,3 +19,6 @@ //: Take a deep breath and move on to the next page. //: //:[Previous](@previous) | page 4 of 7 | [Next: When Things Go Wrong 😰](@next) +//34 + 56 + 230 + +200 + 34 + 45 diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/Errors.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/Errors.xcplaygroundpage/Contents.swift similarity index 99% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/Errors.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/Errors.xcplaygroundpage/Contents.swift index 5bb92de..1d4371e 100644 --- a/01 Playground Basics/PlaygroundBasics.playground/Pages/Errors.xcplaygroundpage/Contents.swift +++ b/01 Playground Basics/01 Playground Basics.playground/Pages/Errors.xcplaygroundpage/Contents.swift @@ -19,3 +19,4 @@ //: Next, read all about your very recent past. //: //:[Previous](@previous) | page 6 of 7 | [Next: Wrapup](@next) +1000/2 diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/Introduction.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/Introduction.xcplaygroundpage/Contents.swift similarity index 100% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/Introduction.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/Introduction.xcplaygroundpage/Contents.swift diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/Introduction.xcplaygroundpage/Resources/playground-logo.pdf b/01 Playground Basics/01 Playground Basics.playground/Pages/Introduction.xcplaygroundpage/Resources/playground-logo.pdf similarity index 100% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/Introduction.xcplaygroundpage/Resources/playground-logo.pdf rename to 01 Playground Basics/01 Playground Basics.playground/Pages/Introduction.xcplaygroundpage/Resources/playground-logo.pdf diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift similarity index 98% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift index 1ae0460..36349f9 100644 --- a/01 Playground Basics/PlaygroundBasics.playground/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift +++ b/01 Playground Basics/01 Playground Basics.playground/Pages/What Is a Playground?.xcplaygroundpage/Contents.swift @@ -27,6 +27,8 @@ Next, find out how to put the results sidebar to better use. [Previous](@previous) | page 2 of 7 | [Next: Calculations](@next) */ - +771 +111 +-1700 diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/When Things Go Wrong.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/When Things Go Wrong.xcplaygroundpage/Contents.swift similarity index 100% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/When Things Go Wrong.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/When Things Go Wrong.xcplaygroundpage/Contents.swift diff --git a/01 Playground Basics/PlaygroundBasics.playground/Pages/Wrapup.xcplaygroundpage/Contents.swift b/01 Playground Basics/01 Playground Basics.playground/Pages/Wrapup.xcplaygroundpage/Contents.swift similarity index 100% rename from 01 Playground Basics/PlaygroundBasics.playground/Pages/Wrapup.xcplaygroundpage/Contents.swift rename to 01 Playground Basics/01 Playground Basics.playground/Pages/Wrapup.xcplaygroundpage/Contents.swift diff --git a/01 Playground Basics/PlaygroundBasics.playground/contents.xcplayground b/01 Playground Basics/01 Playground Basics.playground/contents.xcplayground similarity index 100% rename from 01 Playground Basics/PlaygroundBasics.playground/contents.xcplayground rename to 01 Playground Basics/01 Playground Basics.playground/contents.xcplayground diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/09-ExerciseShow.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/09-ExerciseShow.xcplaygroundpage/Contents.swift index e748d8a..f31999e 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/09-ExerciseShow.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/09-ExerciseShow.xcplaygroundpage/Contents.swift @@ -26,3 +26,13 @@ let numberOfTickets = 150 //: //:[Previous](@previous) | page 10 of 14 | [Next: Exercise: Lottery Tickets](@next) +let numberOfTickets1 = 150 +let numberOfPrice1 = 10 +let numberOfRoomRental1 = 1000 +let numberOfPosterCost1 = 40 + +let numberOfTotalTicket = 150 * 10 + +let numberOfTotalExpense = 1000 + 40 + +let numberOfTotalIncomeOfShow = (150 * 10) - (1000 + 40) diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/10-ExerciseLottery.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/10-ExerciseLottery.xcplaygroundpage/Contents.swift index d2bf006..ee3be37 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/10-ExerciseLottery.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/10-ExerciseLottery.xcplaygroundpage/Contents.swift @@ -14,6 +14,11 @@ let advertising = 50 The calculations below are fixed, but you can change the results by changing the numbers above: */ +let ticketsSold1 = 2100 +let ticketPrice2 = 1 +let printingCosts3 = 60 +let advertising4 = 40 + // Total takings let totalTakings = ticketPrice * ticketsSold @@ -31,3 +36,4 @@ let programmersCut = profit / 10 // This is the answer you want to get over 100! let friendsCut = profit - programmersCut //:[Previous](@previous) | page 11 of 14 | [Next: Exercise: What Fits on Your iPhone?](@next) + diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/11-ExerciseiPhone.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/11-ExerciseiPhone.xcplaygroundpage/Contents.swift index 9830483..63995cd 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/11-ExerciseiPhone.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/11-ExerciseiPhone.xcplaygroundpage/Contents.swift @@ -16,8 +16,9 @@ _Hint_: Do all of your calculations in megabytes (MB). */ - - - - //:[Previous](@previous) | page 12 of 14 | [Next: Exercise: Fixing Your Morning](@next) +let totalIphonStorage = 8 * 1000 +let iphonStorageUsedd = 2 * 1000 +let oneMinutOfVide = 150 + +let minutsOfVideo = (totalIphonStorage - iphonStorageUsedd) / oneMinutOfVide diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/12-ExerciseMorning.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/12-ExerciseMorning.xcplaygroundpage/Contents.swift index a5bbc47..aa24905 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/12-ExerciseMorning.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/12-ExerciseMorning.xcplaygroundpage/Contents.swift @@ -5,8 +5,6 @@ - callout(Exercise): Create a constant for each activity you do in the morning before leaving home: things like `brushTeeth`, `uploadPhotos`, `chooseClothes`, `shower`, `goJogging`, `finishHomework`, `fixLunch`, and so on. Think about how many minutes each activity usually takes, and assign that value to each constant. */ -let brushTeeth = 3 -// Add more here... //: - callout(Exercise): Find the total time of all the activities by adding up the constants. Try to adjust the values or add more activities until the total time looks reasonably close to the actual amount of time you spend getting ready on an average day. @@ -31,3 +29,19 @@ let brushTeeth = 3 //:[Previous](@previous) | page 13 of 14 | [Next: Exercise: Good Names](@next) +let brushTeeth = 3 +// Add more here... + +let UploadPhotos = 3 +let chooseClothes = 5 +let Shower = 5 +let GoJogging = 30 +let FinishHomework = 40 +let FixLunch = 30 + +let TotalTimeSpend = (3 + 3 + 5 + 5 + 30 + 40 + 30) + +let ThingsShouldedo = ( brushTeeth + chooseClothes + Shower) +let ThingsIlikeDo = GoJogging +let thingsIdontLikeDo = FixLunch + diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/13-ExerciseNaming.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/13-ExerciseNaming.xcplaygroundpage/Contents.swift index 4ba787e..e024fa5 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/13-ExerciseNaming.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/13-ExerciseNaming.xcplaygroundpage/Contents.swift @@ -25,11 +25,6 @@ let rhso = co - lhso //: - experiment: Rewrite the code so that it makes sense without needing a note. Use meaningful names and comments. - - - - - /*: _Copyright © 2017 Apple Inc._ @@ -41,3 +36,18 @@ let rhso = co - lhso _THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE._ */ //:[Previous](@previous) | page 14 of 14 +let countOrange = 14 +let countWatermelons = 3 +let orangeWeigh = 100 +let watermelonsWeigh = 200 +let truckOrange = countOrange * orangeWeigh +let truckWatermelons = countWatermelons * watermelonsWeigh +let trucktotal = truckOrange + truckWatermelons +let eachSide = trucktotal / 2 +let leftHandSide = eachSide / orangeWeigh +let rightHandSide = countOrange - leftHandSide + + + + + diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/Good Names.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/Good Names.xcplaygroundpage/Contents.swift index ad84c5c..08f2bfa 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/Good Names.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/Good Names.xcplaygroundpage/Contents.swift @@ -26,3 +26,6 @@ let totalNumberOfMammals = 🐶 + 🐱 + 🐹 + 🐷 //: Next, learn the official names for the work you’ve been doing. //: //:[Previous](@previous) | page 7 of 14 | [Next: Programmer Talk](@next) +let 🕷 = 1 + + diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/Identifiers.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/Identifiers.xcplaygroundpage/Contents.swift index 277161c..4613570 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/Identifiers.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/Identifiers.xcplaygroundpage/Contents.swift @@ -27,3 +27,14 @@ let totalNumberOfMammals = numberOfDogs + numberOfCats + numberOfHamsters //: Next, learn about choosing names. //: //:[Previous](@previous) | page 6 of 14 | [Next: Choosing Good Names](@next) +let numberOfPot = 1 + +let numberOffish = 1 + +let numberOfSnake = 1 + + +let totalNumberOfAnimals1 = numberOfPot + numberOffish + numberOfSnake + +let totalNumberOfMammals2 = numberOfPot + diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/Naming Things.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/Naming Things.xcplaygroundpage/Contents.swift index 6f3f490..36cb052 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/Naming Things.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/Naming Things.xcplaygroundpage/Contents.swift @@ -35,3 +35,11 @@ let totalNumberOfMammals = numberOfDogs + numberOfCats + numberOfHamsters //: Once you’re finished experimenting, move ahead. //: //:[Previous](@previous) | page 4 of 14 | [Next: Typing Names and Autocompletion](@next) + +let numberOfDogs1 = 6 + 2 + +let numberOfCats2 = 5 - 1 + +let numberOfTurtles3 = 2 + 1 + +let numberOfHamsters4 = 1 + 1 diff --git a/02 Naming and Indentifiers/Naming.playground/Pages/Pet Problem.xcplaygroundpage/Contents.swift b/02 Naming and Indentifiers/Naming.playground/Pages/Pet Problem.xcplaygroundpage/Contents.swift index cee5e0a..1a4d793 100644 --- a/02 Naming and Indentifiers/Naming.playground/Pages/Pet Problem.xcplaygroundpage/Contents.swift +++ b/02 Naming and Indentifiers/Naming.playground/Pages/Pet Problem.xcplaygroundpage/Contents.swift @@ -34,3 +34,14 @@ //: Could there be a better way to solve this problem? Think about it for a minute or two, then move on. //: //:[Previous](@previous) | page 2 of 14 | [Next: Pet Problem Recap](@next) +//number of Dog +5 + 1 + +//number of turtles +3 - 1 + +//number of cat +5 + 1 + +//number of a mammal +9 + 1 diff --git a/03 Strings/Strings.playground/Pages/Combining Strings.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/Combining Strings.xcplaygroundpage/Contents.swift index 8be7569..6466c99 100644 --- a/03 Strings/Strings.playground/Pages/Combining Strings.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/Combining Strings.xcplaygroundpage/Contents.swift @@ -35,3 +35,11 @@ let finishedMessage = username + " " + likesYourPostMessage //: Next, find out how building strings by adding them can get complicated. //: //:[Previous](@previous) | page 5 of 16 | [Next: Fill In The Blanks](@next) +let FirstName = "Bushra" +let LastName = "Alatwi" + +let LikesYourPostMessage = "likes your post" +let FinishedMessage1 = FirstName + " " + LastName +let FinishedMessage2 = FirstName + " " + LikesYourPostMessage + + diff --git a/03 Strings/Strings.playground/Pages/Defining Strings.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/Defining Strings.xcplaygroundpage/Contents.swift index b06247c..5dc3c8e 100644 --- a/03 Strings/Strings.playground/Pages/Defining Strings.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/Defining Strings.xcplaygroundpage/Contents.swift @@ -16,3 +16,6 @@ let traditionalGreeting = "Hello, world!" //: Next, take a string-based trip around the world. //: //:[Previous](@previous) | page 3 of 16 | [Next: Unicode](@next) +let favoriteMovie = "The Dream" + +let favoriteSong = "Love" diff --git a/03 Strings/Strings.playground/Pages/Exercise-A Restaurant.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/Exercise-A Restaurant.xcplaygroundpage/Contents.swift index 79b569b..3493ba2 100644 --- a/03 Strings/Strings.playground/Pages/Exercise-A Restaurant.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/Exercise-A Restaurant.xcplaygroundpage/Contents.swift @@ -34,3 +34,29 @@ let tableTwoResponse = "Perfect, merci bien." //: //:[Previous](@previous) | page 14 of 16 | [Next: Exercise: Go! Fight! Win!](@next) +let ServerResponseToTableOne = "Let me make sure I've got this right: \(customerOrderOne).Is that everything?" + +let tableTwoResponseOne = "Perfect, Thanks." + +let serverResponseToTableTow = "Let me make sure I've got this right: \(customerOrderTwo).Is that everything?" + +let tableTwoResponseTow = "thanks." + +let serverResponseToTableThree = "Let me make sure I've got this right: \(customerOrderThree).Is that everything?" + +let tableTwoResponseThree = "Perfect, merci bien." + +let serverResponseToTableFour = "Let me make sure I've got this right: \(customerOrderFour).Is that everything?" + +let tableTwoResponseFour = "Perfect." + +let serverResponseToTableFive = "Let me make sure I've got this right: \(customerOrderFive).Is that everything?" + +let tableTwoResponseFive = "Perfect, merci bien." + +let serverResponseToTableSix = "Let me make sure I've got this right: \(customerOrderSix).Is that everything?" + +let tableTwoResponseSix = "thanks." + + + diff --git a/03 Strings/Strings.playground/Pages/Exercise-Displaying Values.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/Exercise-Displaying Values.xcplaygroundpage/Contents.swift index cbb0924..71f30fe 100644 --- a/03 Strings/Strings.playground/Pages/Exercise-Displaying Values.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/Exercise-Displaying Values.xcplaygroundpage/Contents.swift @@ -14,20 +14,9 @@ _Hint:_ Do all of your calculations in megabytes. */ - - - - - - -/*: - - _Copyright © 2017 Apple Inc._ - - _Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:_ - - _The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software._ - - _THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE._ - */ -//:[Previous](@previous) | page 16 of 16 +let totaliphonestorega = 8 * 1000 +let iPhonesstoregaused = 3 * 1000 +let oneMinutofvideo = 150 +let leftStorage = totaliphonestorega - iPhonesstoregaused +let minutsofvideotofilliphone = leftStorage/oneMinutofvideo +let user = "you can record \(minutsofvideotofilliphone) more minutes of video." diff --git a/03 Strings/Strings.playground/Pages/Exercise-Go! Fight! Win!.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/Exercise-Go! Fight! Win!.xcplaygroundpage/Contents.swift index edcc1ae..e7de3b3 100644 --- a/03 Strings/Strings.playground/Pages/Exercise-Go! Fight! Win!.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/Exercise-Go! Fight! Win!.xcplaygroundpage/Contents.swift @@ -26,3 +26,10 @@ let song = "\(refrain)\n\(refrain)\nYes, \(refrain)" //: //:[Previous](@previous) | page 15 of 16 | [Next: Exercise: Displaying Values](@next) + +let mySchoolName = "ASTRA SCHOOL" +let myrefrain = "laaa llllaaaa\(schoolName)laallllaaaa" + +let mysong = "\(refrain)\n\(refrain)\nYes, \(refrain)" + + diff --git a/03 Strings/Strings.playground/Pages/Exercise-Making a List.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/Exercise-Making a List.xcplaygroundpage/Contents.swift index 59607e3..5d6b8f8 100644 --- a/03 Strings/Strings.playground/Pages/Exercise-Making a List.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/Exercise-Making a List.xcplaygroundpage/Contents.swift @@ -19,3 +19,14 @@ let newline = "Making new lines" //: //:[Previous](@previous) | page 13 of 16 | [Next: Exercise: A Restaurant](@next) +let thingsIHaveLeared = """ +\(constants) +\(unicode) +\(combining) +\(interpolation) +\(escaping) +\(newline) +""" +print (thingsIHaveLeared) + + diff --git a/03 Strings/Strings.playground/Pages/More Than Strings.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/More Than Strings.xcplaygroundpage/Contents.swift index 8d2ee9e..5eec193 100644 --- a/03 Strings/Strings.playground/Pages/More Than Strings.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/More Than Strings.xcplaygroundpage/Contents.swift @@ -23,3 +23,17 @@ let goalieReportString = "At the game yesterday, \(goalieName) had \(firstHalfSa //: Next you’ll see a few more tricks with strings. //: //:[Previous](@previous) | page 9 of 16 | [Next: The Great Escape](@next) +let name = "me And huda" +let number = 600 +let adjective = "a butful" +let noun = "dress" +let noun2 = "max" +let place = "shop" +let positiveEmotion = "happy" +let negativeEmotion = "sad" +let noun3 = "stock" + +let fullStory: String = """ +Today was a big day for \(name). They had finally saved up \(number) dollars and were going to buy a \(adjective + noun). They went to the \(noun2 + place) feeling very \(positiveEmotion). But then they felt \(negativeEmotion). They were all out of \(noun3)! +""" +print(fullStory) diff --git a/03 Strings/Strings.playground/Pages/String Interpolation.xcplaygroundpage/Contents.swift b/03 Strings/Strings.playground/Pages/String Interpolation.xcplaygroundpage/Contents.swift index cd184be..cb5606e 100644 --- a/03 Strings/Strings.playground/Pages/String Interpolation.xcplaygroundpage/Contents.swift +++ b/03 Strings/Strings.playground/Pages/String Interpolation.xcplaygroundpage/Contents.swift @@ -25,3 +25,7 @@ let reason = "tasty" //: On the next page, see what happens with long strings. //: //:[Previous](@previous) | page 7 of 16 | [Next: Viewing Playground Results](@next) +let FavoriteFood = "pizza" +let Reason = "tasty" + +let welcomeS = "Ilike \(favoriteFood), because it is \(reason)"