GAME: Is It Prime?

  // //  ViewController.swift //  test // //  Created by Maribel Aristy on 12/19/17. //  Copyright © 2017 Maribel Aristy. All rights reserved. // import UIKit class ViewController: UIViewController {     @IBOutlet var numberTextField: UITextField!     @IBAction func isItPrime(_ sender: AnyObject) {         if let userEnteredString = numberTextField.text {   Read more about GAME: Is It Prime?[…]

FOR LOOPS – Double Numbers

var sampleArray = [8.0, 7.0, 19.0, 28.0] for (index,value) in sampleArray.enumerated(){     sampleArray [index] = value / 2 } print(sampleArray) // “.0” in each number changes it from integer to double, that way when we divide them by 2 the result will be more accurate. Another way to do it: var sampleArray = [Double]() Read more about FOR LOOPS – Double Numbers[…]