Advertisement
applehelpwriter

Swift: currency converter

Jun 4th, 2014
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //swift
  2. //currency converter
  3.  
  4. func poundsToBaht(rate:Int, pounds:Int) -> String{
  5.     let baht = rate*pounds
  6.     return \(pounds) is \(baht) baht."
  7. }
  8.  
  9. func bahtToPounds(rate:Int, baht:Int) -> String{
  10.     let pounds = baht/rate
  11.     return "\(baht) baht is £\(pounds)."
  12. }
  13.  
  14. poundsToBaht(51, 3000)
  15. bahtToPounds(51, 660000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement