当前位置: 首页 > news >正文

网站建设导航图图库php大型网站开发

网站建设导航图图库,php大型网站开发,旺道seo推广有用吗,韶关建设局网站练习 4.1 1. 判断题 判断下列描述的对错。 #xff08;1#xff09;子类是父类的子集。 #xff08; ✖ #xff09; #xff08;2#xff09;父类中非私密的方法能够被子类覆盖。 #xff08; ✔ #xff09; #xff08;3#xff09;子类…练习 4.1 1. 判断题 判断下列描述的对错。 1子类是父类的子集。             ✖   2父类中非私密的方法能够被子类覆盖。          ✔   3子类能够覆盖父类的私密方法。    ✖  4子类能够覆盖父类的初始化方法。   ✔   5当创建一个类的实例时该类的父类的初始化方法会被自动调用。   ✔   6所有的对象都是object类的实例。    ✔  7如果一个类没有显式地继承自某个父类则就默认它继承自object类。    ✔  2. 代码分析题 阅读下面的代码给出输出结果。 1 class Parent(object):x 1class Child1(Parent):passclass Child2(Parent):passprint (Parent.x, Child1.x, Child2.x) Child1.x 2 print (Parent.x, Child1.x, Child2.x) Parent.x 3 print (Parent.x, Child1.x, Child2.x) 1 1 1 1 2 1 3 2 3 2  class FooParent(object): def __init__(self): self.parent I\m the parent. print (Parent) def bar(self,message): print( message,from Parent)class FooChild(FooParent): def __init__(self): super(FooChild,self).__init__() print (Child) def bar(self,message): super(FooChild, self).bar(message) print (Child bar fuction) print (self.parent)if __name__ __main__:fooChild FooChild()fooChild.bar(HelloWorld)Parent Child HelloWorld from Parent Child bar fuction Im the parent. 3 class A(object):def tell(self):print(A tell)self.say()def say(self):print(A say)self.__work()def __work(self):print(A work)class B(A):def tell(self):print(\tB tell)self.say()super(B, self).say()A.say(self)def say(self):print(\tB say)self.__work()def __work(self):print(\tB work)self.__run()def __run(self): # privateprint(\tB run)b B();b.tell()B tell     B say     B work     B run A say A work A say A work 3. 程序设计题 1编写一个类由int类型派生并且可以把任何对象转换为数字进行四则运算。 2编写一个方法当访问一个不存在的属性时会提示“该属性不存在”但不停止程序运行。 3为学校人事部门设计一个简单的人事管理程序满足如下管理要求。 ① 学校人员分为三类教师、学生、职员。 ② 三类人员的共同属性是姓名、性别、年龄、部门。 ③ 教师的特别属性是职称、主讲课程。 ④ 学生的特别属性是专业、入学日期。 ⑤ 职员的特别属性是部门、工资。 ⑥ 程序可以统计学校总人数和各类人员的人数并随着新人进入注册和离校注销而动态变化。 class Person:def __init__(self, name, gender, age, department):self.name nameself.gender genderself.age ageself.department departmentclass Teacher(Person):def __init__(self, name, gender, age, departmentNone, titleNone, main_courseNone):super().__init__(name, gender, age, department)self.title titleself.main_course main_courseclass Student(Person):def __init__(self, name, gender, age, departmentNone, majorNone, enrollment_dateNone):super().__init__(name, gender, age, department)self.major majorself.enrollment_date enrollment_dateclass Employee(Person):def __init__(self, name, gender, age, departmentNone, salaryNone):super().__init__(name, gender, age, department)self.salary salary# 人员列表用于存储所有人员信息 people []# 添加新人员函数 def add_person(person_type, name, gender, age, department):if person_type teacher:people.append(Teacher(name, gender, age, department))elif person_type student:people.append(Student(name, gender, age, department))elif person_type employee:people.append(Employee(name, gender, age, department))else:print(Invalid person type.)returnprint(f{person_type} {name} added successfully.)print(fTotal {person_type}s: {len([p for p in people if isinstance(p, person_type)])})print(Total people: , len(people))# 统计各类人员数量的函数 def count_people():total_teachers len([p for p in people if isinstance(p, Teacher)])total_students len([p for p in people if isinstance(p, Student)])total_employees len([p for p in people if isinstance(p, Employee)])print(fTotal teachers: {total_teachers})print(fTotal students: {total_students})print(fTotal employees: {total_employees})print(fTotal people: {len(people)}) 4为交管部门设计一个机动车辆管理程序功能包括如下要求。 ① 车辆类型大客、大货、小客、小货、摩托、生产日期、牌照号、办证日期。 ② 车主姓名、年龄、性别、住址、身份证号。
http://www.hkea.cn/news/14569148/

相关文章:

  • h5网站案例无障碍环境建设 网站
  • 网站建设公司的成本有哪些内容在网站中设置网站地图
  • 外贸仿牌网站建设做鞋子有什么好网站好
  • 珠海市外贸网站建设公司高级网站开发工程师考试题
  • 网站开发技术语言大千科技网站建设
  • 做资格核查在哪个网站中国建设银行网站查询密码是什么意思
  • 工程业绩在建设厅网站都能查到微信微网站统计
  • 孝感做网站公司游戏优化大师官网
  • 安徽省公共资源交易中心网站电商一共有什么平台
  • 长春搜索引擎网站推广线下推广引流渠道
  • 中国未来巨型空间站网站建设与开发课程内容
  • 老外做牛排的视频网站网站建设公司推荐q479185700顶上
  • node做网站后台西安企业模板建站
  • 石家庄网推公司郑州seo顾问
  • 东莞网站建设求职简历网站设置右击不了如何查看源代码
  • 东莞建网站的公查公司的网站有哪些
  • 网站建设与管理知识点互联网保险公司有哪几家
  • 微网站建设正规公司宿州高端网站建设公司哪家好
  • 服装网站网络建设和硬件资源商贸公司起名大全最新
  • 怎么做网站的浏览量常德网站开发网站运营
  • 自己架设服务器做网站个人网站 备案
  • 怎么做公司宣传网站岳阳网站建设收费标准
  • 做电商网站的上海公司手机人才网
  • asp网站制作教程重庆个人网站建设
  • 关于 门户网站 建设 请示信誉好的低价网站建设
  • 东莞品牌型网站建设科技类公司网站设计
  • 珠宝公司网站模版亚马逊aws wordpress
  • 网站权重分析域名有了怎么建设网站
  • 简单的seo网站优化排名在线房产网
  • 生活服务网站开发与设计网络营销师培训费用是多少