• Write a function that takes an integer from 1 to 10000. Find the square root without using the sqrt function. Should include the error handling we’ve been working on. My solution

    ·

  • Functions 2 How to provide default values for parameters Say we want to provide a default value for a parameter. Ex: We can do: Or: Now these are legal: Scored 9/12 on default parameters How to handle errors in functions studysubject We need to handle errors gracefully or our code will crash. Error handling in…

    ·

  • Loop through a range of 1 to 100 inclusive and write: Note: I didn’t bother with reading the hints, but a good tip was to use the isMultiple(of: n) Onward.

    ·

  • Loops How to use a for loop to repeat work Computers are made to do repetitive work. Swift uses loops to do things any number of times or once per item in a dictionary, array, or set. Simple example: Looping over a fixed range. Ex: Nested loops: Ex: Ranges: x…y are inclusive of x and…

    ·

  • Conditions How to check a condition is true or false Basic syntax Braces signal the start and end of a code block. Another example Another example Another example String comparison Example Other ways to check truthiness How to check multiple conditions We want to be able to control the program flow whether something is true…

    ·