Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Loan {
- var expiryDate: String?
- var maturityDate: String?
- func capital() -> Double {
- if expiryDate != nil && maturityDate != nil {
- return 10.0 * duration() * riskFactor()
- }
- if expiryDate != nil && maturityDate == nil {
- if getUnusedPercentage() > 1.0 {
- return 150.0 * getUnusedPercentage()
- } else {
- return 200.0 * getUnusedPercentage()
- }
- }
- return 0.0
- }
- func duration() -> Double {
- return 0.0
- }
- func riskFactor() -> Double {
- return 0.0
- }
- func getUnusedPercentage() -> Double {
- return 5.0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement