-
大小: 360KB文件类型: .7z金币: 2下载: 1 次发布日期: 2021-06-12
- 语言: C#
- 标签: Visual.C#201 光盘源码
资源简介
Visual.C#2010从入门到精通 光盘源码
代码片段和文件信息
class Customer:
def __init__(self id name telephone):
self.custID = id
self.custName = name
self.custTelephone = telephone
def __str__(self):
return str.format(“ID: {0}\tName: {1}\tTelephone: {2}“
self.custID self.custName self.custTelephone)
class CustomerDB:
def __init__(self):
self.customerDatabase = {}
def storeCustomer(self customer):
self.customerDatabase[customer.custID] = customer
def getCustomer(self id):
return self.customerDatabase[id]
def __str__(self):
list = “Customers\n“
for id cust in self.customerDatabase.iteritems():
list += str.format(“{0}“ cust) + “\n“
return list
def GetNewCustomer(id name telephone):
return Customer(id name telephone)
def GetCustomerDB():
return CustomerDB()
- 上一篇:C# 读取电能表度数 DLT645协议
- 下一篇:C# 表达式解析器源代码(修正)
评论
共有 条评论