Last active
June 11, 2020 10:07
-
-
Save TarasShu/82e816621ec84879f0d684671eed5ca7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let totalRent = 5300 | |
let electrecityBills = 1241 | |
let arnonaBill = 153 | |
var roomates = 3 | |
let repairBill = 414 | |
var month = 0 | |
func electrecity(_ name: String) -> String { | |
if name != "Taras" { | |
month == 4 | |
return "\(name) owes \(month * electrecityBills / roomates) for electrecity" | |
} else if name == "Oleg" { | |
month == 3 | |
return " \(name) owes \(month * (electrecityBills - repairBill) / roomates) for electrecity" | |
} | |
if name == "Taras" { | |
month == 1 | |
return " \(name) owes \(month * (electrecityBills - repairBill) / roomates) for electrecity" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment