Coder Social home page Coder Social logo

swift-conditionals-lab's Introduction

Math, Booleans & Conditionals Lab

Neil

Curious that we spend more time congratulating people who have succeeded than encouraging people who have not. -Neil deGrasse Tyson

Overview

This lab will give you practice with math, booleans, and conditionals.

Instructions

  • Open up the playground file included with this repo and answer the listed questions (which you will find in the playground file) in order.
  • There are no tests associated with this playground file.

View this lesson on Learn.co

swift-conditionals-lab's People

Contributors

annjohn avatar ianrahman avatar jimcampagno avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

guyardito

swift-conditionals-lab's Issues

Solution to Question 11

The solution to question 11 seems flawed: https://github.com/learn-co-curriculum/swift-conditionals-lab/blob/solution/MyPlayground.playground/Pages/solution.xcplaygroundpage/Contents.swift#L116

question11solution

Statements like myAccount + 10 have no effect, as the new value is not stored in a variable. To update the value of myAccount, the code should be myAccount = myAccount + 10 or myAccount += 10.

However, Swift does not allow modifying arguments unless you put inout before the parameter type (e.g. myAccount: inout Int). I don't believe this concept has been covered in the curriculum so far.

I propose either revising question 11 itself, revising the solution to use inout and more effective statements like myAccount = myAccount + 10 (and including a note to students explaining the solution), or introducing inout before this lab.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.