Home > Back-end >  Pray god to help me homework assignments, thank you
Pray god to help me homework assignments, thank you

Time:01-08

Multiple inheritance and virtual base class comprehensive design project, using multiple inheritance, virtual base class and file I/O flow method to design a project, to achieve a ZuJiao worker information processing and analysis, first of all, declare a class faculty Staff, its data members including name (name), age (age), gender (sex), wages (salary), address (addr) and phone (tel) etc., the member function including the constructor Staff (), and the worker information display function display (), then, to the Staff for the virtual base class, derived by means of public inheritance Teacher class Cadre of the Teacher and the class Cadre; The Teacher class a new data member title (the title), Cadre class members to Post a new data (position); Two must be through the constructor for the respective object assignment, and need to rewrite its parent class each new member information output display function, and finally on the basis of the class the Teacher and the class Cadre, by way of multiple public inheritance a Cadre of teachers class CDTer (ShuangJianTiao personnel), a new data members most egregious nest-feathering (allowance) and for the members of the information output function show (), which can display the father object (function implementation, on the basis of
Through the keyboard input data from the following five staff:
(1) zhang sanfeng, 52 years old, male, professor, the headmaster, salary: 20000, subsidies: 3000,
Address: haidian district of Beijing tsinghua east road no. 183, telephone: 20300183
(2) good li si, 40 years old, male, associate professor, salary: 15000
Address: guangzhou tianhe five mountain road no. 483, telephone: 85260483
(3) Wang Wuxing, 32 years old, male, lecturer, salary: 10000
Address: Shanghai pudong district no. 286 nanjing road, telephone: 86202028
(4) Zhou Dong rain, 28 years old, female, lecturer, salary: 9000
Address: shenzhen nanshan district no. 328 Beijing road, telephone: 83280506
(5) the silurian Yang, 26, male, ta, salary: 6000
Address: 239 yuquan road in huangpu district of chengdu, telephone: 62390609
Design requirements:
? The faculty of the input information is saved to disk file staff. TXT
? From the disk file to read the 1st,3,5 data and display the staff
? Modify the fourth teachers and save the data to its original position
- modify the name as: zhou
- modify age: 26
? Five former employees from a disk file into the revised data, calculate the average wage and and display,
  • Related