Created
June 10, 2020 10:41
-
-
Save TarasShu/e8e2feac9da882cc915fd16a10546b25 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: Double = 5340 | |
let electricityRepairCost: Int = 414 | |
let electricityBill: Double = 1241 | |
let waterBill: Double | |
let arnonaBill: Double | |
let cleaningBill: Double | |
//struct Rent { | |
// | |
// let name: String | |
// let months: Int | |
// var bill: Int | |
// let sum: Int | |
// let electricityBill: Int | |
// let waterBill: Int | |
// let arnonaBill: Int | |
// let cleaningBill: Int | |
//} | |
struct Person { | |
var months: Int | |
let repairsElectricity: Bool | |
var totalBillElectricity: Double | |
func electricity(bill: Int) -> Double { | |
if repairsElectricity { | |
return (totalBillElectricity + Double(electricityRepairCost)) * months | |
} else if { | |
return totalBillElectricity | |
} else return totalBillElectricity + Double(electricityRepairCost) * months | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment