Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. @IBAction func calculerButtonAction(_ sender: Any) {
  2.  
  3. let coteOneValue :Float = (self.coteOneTF.text! as NSString).floatValue
  4. let coteTwoValue :Float = (self.coteTwoTF.text! as NSString).floatValue
  5. let coteThreeValue:Float = (self.coteThreeTF.text! as NSString).floatValue
  6.  
  7. let valueOne :Float = 1/coteOneValue
  8. let valuetwo :Float = 1/coteTwoValue
  9. let valueThree :Float = 1/coteThreeValue
  10.  
  11. let miseValue :Float = valueOne + valuetwo + valueThree
  12. print(miseValue)
  13. let miseConstantValue : Float = 1.0
  14. if miseValue <= miseConstantValue {
  15.  
  16. let alert = UIAlertController(title: "Information", message: "C' est un surebet", preferredStyle: UIAlertControllerStyle.alert)
  17. alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
  18. self.present(alert, animated: true, completion: nil)
  19. }
  20. else {
  21.  
  22. let alert = UIAlertController(title: "Information", message: "C' est pas un surebet", preferredStyle: UIAlertControllerStyle.alert)
  23. alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
  24. self.present(alert, animated: true, completion: nil)
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement