Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. @IBOutlet weak var P1: UITextField!
  2. @IBOutlet weak var P2: UITextField!
  3.  
  4.  
  5. @IBOutlet weak var F1: UILabel!
  6. @IBOutlet weak var F2: UILabel!
  7.  
  8.  
  9. @IBOutlet weak var res1: UILabel!
  10.  
  11.  
  12.  
  13. override func viewDidLoad() {
  14. super.viewDidLoad()
  15. // Do any additional setup after loading the view, typically from a nib.
  16. }
  17.  
  18. override func didReceiveMemoryWarning() {
  19. super.didReceiveMemoryWarning()
  20. // Dispose of any resources that can be recreated.
  21. }
  22.  
  23. @IBAction func total(_ sender: Any) {
  24.  
  25.  
  26. let n1 = Double(N1.text!)
  27. let p1 = Double(P1.text!)
  28. let f1 = Double(n1! + p1!)
  29.  
  30. F1.text = "(f1)"
  31.  
  32. int x = [[F1.text] x];
  33.  
  34. let n2 = Double(N2.text!)
  35. let p2 = Double(P2.text!)
  36. let f2 = Double(n2! + p2!)
  37.  
  38. F2.text = "(f2)"
  39.  
  40.  
  41. res1.text = "(res1)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement