title: How to check boolean value in integer Swift
body: <p>
  I am new to Swift, and I'm trying to make a login program for Mac OS X. I do know about Swift programming on iOS, but I don't know that much about OS X Swift. So I wrote a program for OS X. I almost finished it, but i want to check my boolean details by integer for example i wanted to make if student's score is equal to my variable, it show the grade that you got.</p>
  
  <pre><code>class ViewController: NSViewController {
  
  @IBOutlet var Maths: NSTextField! = NSTextField()
  @IBOutlet var Science: NSTextField! = NSTextField()
  @IBOutlet var English: NSTextField! = NSTextField()
  @IBOutlet var Religious: NSTextField! = NSTextField()
  @IBOutlet var History: NSTextField! = NSTextField()
  @IBOutlet var Geography: NSTextField! = NSTextField()
  @IBOutlet var ICT: NSTextField! = NSTextField()
  @IBOutlet var Computing: NSTextField! = NSTextField()
  
  @IBOutlet var Total: NSTextField!
  @IBOutlet var AVG: NSTextField!
  
  @IBOutlet var StudentName: NSTextField!
  @IBOutlet var StudentClass: NSTextField!
  
  @IBOutlet var Report: NSTextField!
  
  
  var A = 80 &gt; 100
  var B = 75 &gt; 80
  var C = 60 &gt; 75
  var D = 50 &gt; 60
  var E = 40 &gt; 50
  var F = 0 &gt; 40
  
  
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
  
  
  }
  
  override var representedObject: AnyObject? {
      didSet {
      // Update the view, if already loaded.
  
  
      }
  }
  
  @IBAction func CountTotalnAVG(sender: NSButton) {
  
      var Mathsc = Maths.stringValue.toInt()
      var Sciencec = Science.stringValue.toInt()
      var Englishc = English.stringValue.toInt()
      var Religiousc = Religious.stringValue.toInt()
      var Historyc = History.stringValue.toInt()
      var Geographyc = Geography.stringValue.toInt()
      var ICTc = ICT.stringValue.toInt()
      var computingc = Computing.stringValue.toInt()
  
      /*
      var add = (Mathsc?.advancedBy(Sciencec!).advancedBy(Englishc!).advancedBy(Religiousc!).advancedBy(Historyc!).advancedBy(Geographyc!).advancedBy(ICTc!).advancedBy(computingc!))
      */
  
      var add: Int = (Mathsc! + Sciencec! + Englishc! + Religiousc! + Historyc! + Geographyc! + ICTc! + computingc!)
  
      Total.stringValue = "\(add)"
  
      var divide:Int = add/8
  
      AVG.stringValue = "\(divide)"
  
  }
  
  @IBAction func GetReport(sender: NSButton) {
  
      var A = 80 &gt; 100
      var B = 75 &gt; 80
      var C = 60 &gt; 75
      var D = 50 &gt; 60
      var E = 40 &gt; 50
      var F = 0 &gt; 40
  
      var Mathsc = Maths.stringValue.toInt()
      var Sciencec = Science.stringValue.toInt()
      var Englishc = English.stringValue.toInt()
      var Religiousc = Religious.stringValue.toInt()
      var Historyc = History.stringValue.toInt()
      var Geographyc = Geography.stringValue.toInt()
      var ICTc = ICT.stringValue.toInt()
      var computingc = Computing.stringValue.toInt()
  
      if Mathsc = A.boolValue {
  
      }
  }    
  }
  </code></pre>