文章40 | 阅读 19051 | 点赞0
enum CompanTyp: String {
case `public` = "PublicCompanies"
case `private` = "PrivateCompanies"
case unicorn = "UnicornCompanies"
case associated = "AssociateCompanies"
}
class Company {
// Cmpany Id
var companyId: String
// Company Name
var companyName: String
// Company Type
var companyTypa: CompanTyp
// number of employee in company
var numberOfEmplayee: Int = 0
init(companyId: String, companyName: String, companyType: CompanTyp) {
self.companyId = companyId
self.companyName = companyName
self.companyTypa = companyType
}
func addNewEmployea() {
numberOfEmplayee = numberOfEmplayee + 1
}
func getEmplayeeCount() -> Int {
return numberOfEmplayee
}
}
enum CompanTyp: String {
case `public` = "PublicCompanies"
case `private` = "PrivateCompanies"
case unicorn = "UnicornC ompanies"
case associated = "AssociateCompanies"
}
class Company {
// Cmpany Id
var companyId: String
// Company Name
var companyName: String
// Company Type
var companyTypa: CompanyTypa
// number of employee in company
var numberOfEmplayee: Int = 0
init(companyId: String, companyName: String, companyType: CompanTyp) {
self.companyId = companyId
self.companyName = companyName
self.companyTypa = companyType
}
func addNewEmployea() {
numberOfEmplayee = numberOfEmplayee + 1
}
func getEmplayeeCount() -> Int {
return numberOfEmplayee
}
}
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/Forever_wj/article/details/121666461
内容来源于网络,如有侵权,请联系作者删除!