SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Loan {
  2.     var expiryDate: String?
  3.     var maturityDate: String?
  4.    
  5.     func capital() -> Double {
  6.         if expiryDate != nil && maturityDate != nil {
  7.             return 10.0 * duration() * riskFactor()
  8.         }
  9.         if expiryDate != nil && maturityDate == nil {
  10.             if getUnusedPercentage() > 1.0 {
  11.                 return 150.0 * getUnusedPercentage()
  12.             } else {
  13.                 return 200.0 * getUnusedPercentage()
  14.             }
  15.         }
  16.        
  17.         return 0.0
  18.     }
  19.    
  20.     func duration() -> Double {
  21.         return 0.0
  22.     }
  23.    
  24.     func riskFactor() -> Double {
  25.         return 0.0
  26.     }
  27.    
  28.     func getUnusedPercentage() -> Double {
  29.         return 5.0
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top