Code Monkey home page Code Monkey logo

conditionalsandoptionals-master's Introduction

Conditionals And Optionals

This project will help you practice the skills and concepts you learned related to logical comparison operators, Boolean operators, and Optionals in Swift.

Unlike the previous two projects, this project is all done in playgrounds. Follow the instructions below:

Download the Playground

  1. Download the playground for this project by clicking here.
  2. Unzip the downloaded file.
  3. Open the included ConditionalsAndOptionals.playground file using Xcode

Do the Excercises

This project consists of multiple pages. You can see all the pages by choosing View->Navigators->Show Navigators in the View menu in Xcode.

  1. Complete all the excercises on the first page.
  2. Go to the next page by clicking the "Next" link at the bottom of the playground, or by selecting it in the files navigator on the left side.
  3. Repeat until you've completed all pages in the playground.

Bonus

If you finish and want another challenge try the following:

  1. Open your Flashlight project from day 1.
  2. Modify the project so that when the "Turn Flashlight On" button is clicked, the screen turns bright if the current time is between the hours of 8 AM and 10 PM. If the the current time is between the hours of 10 PM and 8 AM (night time), make the screen gray instead.

Hint: You can get the current hour (in 24-hour time) using the following snippet of code. Note that hour here is an Int?.

let calendar = Calendar(identifier: .gregorian)
let currentDate = Date()
let hour = calendar.dateComponents([.hour], from: currentDate).hour

This code includes syntax and concepts we haven't covered yet. It's OK for you to copy and paste it to use it now. You'll learn enough to understand it later.

Submit

Zip up the ConditionalsAndOptionals.playground file after you've finished all the excercises. Submit the zipped playground file to your project manager (PM).

conditionalsandoptionals-master's People

Contributors

doyoung2win avatar

Watchers

James Cloos avatar

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.