Location:
Search - WorStu
Search list
Description: c++基本类使用以及操作。对初学者很有帮助,启发面向对象思想-c use of the basic group and the operation. For beginners helpful, instructive object-oriented thinking
Platform: |
Size: 728064 |
Author: 吕志坤 |
Hits:
Description: 设计一个基类Person。通过该类保存人员的最基本信息:姓名(Name)、年龄(Age)和性别(Gender)。然后使用该类派生出工人类Worker和学生类Student,在其中添加各自的特性,如在Student类中添加如下信息:院系(department)、专业(speciality)和学号(number)等,在Worker类中添加如下信息:部门(department)和工作(job)等。最后,由于职工大学学员不仅是学生,而且在社会上还是工人,因此需要具备2中属性特征。于是在这2个派生基类的基础上再次派生出学员类WorStu,不仅具备Worker的属性,而且具有Student属性。-Design a base class Person. Saved by such personnel in the most basic information: name (Name), age (Age) and gender (Gender). And then use the class derived from labor, human Worker and student class Student, which add their own features, such as the Student class to add the following information: faculty (department), profession (speciality) and school ID (number) and so on, in the Worker class to add the following information: department (department) and work (job) and so on. Finally, university students, since trade unions are not only students, but also in the community or workers, so need to have two features in the property. So these two derived on the basis of the base class to derive another class students WorStu, not only have the Worker' s attributes, but also with the Student attributes.
Platform: |
Size: 1024 |
Author: 月月 |
Hits: