Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement