This file contains hidden or 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
struct Rectangle { | |
var width: Double = 10 | |
var area: Double = 100 | |
var height: Double { | |
get { | |
return area / width | |
} | |
set (height) { |
This file contains hidden or 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
class SurveyQuestion2 { // сделали класс | |
let text: String // внесли константу задали ей тип | |
var response: String? // внесли переменную, задали ей тип , который может быть пустым nil | |
init(text: String) { // задалаи проперти константе | |
self.text = text // задали, что text (который init(text: String)) берет значение text (который let) | |
} | |
func ask() { // сделали функцию , задача которой печать то, что находиться в text | |
print(text) | |
} | |
} |
This file contains hidden or 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 { |
This file contains hidden or 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
var billElectricity: Double = 1241.7 | |
let repair: Double = 414 | |
let quantityRoomate: Double = 3 | |
let fourMonth: Double = 4 | |
let olegLived: Double = 3 | |
var taras: Double = ((1241.7 - repair)/fourMonth)/quantityRoomate | |
billElectricity -= taras |
This file contains hidden or 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 { |
This file contains hidden or 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 name = "Тарас" | |
// | |
var poka = true | |
if name == "Тарас" { | |
poka = true | |
} else { | |
poka = !poka | |
} | |
var poshel = " ,fuck off" |
This file contains hidden or 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 nameYourMom: String? = "" | |
let forcedString: String = nameYourMom? | |
if nameYourMom != nil { | |
print("Your mom, \(nameYourMom!), is a bitch") | |
} else { | |
print("Please write your mother's name") | |
} |
NewerOlder