当前位置:网站首页>Week 12 - task 2- shoulder to shoulder cadres
Week 12 - task 2- shoulder to shoulder cadres
2022-06-29 05:46:00 【sxhelijian】
【 subject 】( The teaching material P394 exercises 9) Defining the Teacher( Teachers' ) Classes and Cadre( Cadres ) class , A new class is derived from these two classes by means of multiple inheritance Teacher_Cadre( Teachers and cadres ). requirement :
(1) Include names in both base classes 、 Age 、 Gender 、 Address 、 Telephone and other data members .
(2) stay Teacher Class also contains data members title( The title ), stay Cadre Class also contains data members post( position ), stay Teacher_Cadre Class also contains data members wages( Wages ).
(3) For names in two base classes 、 Age 、 Gender 、 Address 、 Telephone and other data members use the same name , When referring to these data members , Specify scope .
(4) Declare member functions in the body of the class , Define member functions outside the class .
(5) In derived classes Teacher_Cadre Member function of show Call in Teacher Class display function , Export name 、 Age 、 Gender 、 The title 、 Address 、 Telephone , And then use cout Statement output job and salary .
( In some universities , Teachers with administrative positions , be called “ Shoulder to shoulder ”. I did , I can't pick , I dropped one end , It's what it is now .)
【 analysis 】 The key to this problem is to have data members with the same name in two base classes , The ambiguity caused by multiple inheritance arises . In a derived class , Need to pass through “ Class name :: Member name " Form solution . This is one way to solve this kind of problem .
【 Reference code 】
边栏推荐
- Use some examples of qte5
- Robot reinforcement learning - transferring end-to-end videomotor control from simulation to realworld (curl 2017)
- Mongodb basic knowledge summary
- Alibaba microservice component Sentinel
- Use VS to create a static link library Lib and use
- 5- (4-benzoimide phenyl) - 10,15,20-triphenylporphyrin (battph2) and its Zn complex (battpzn) / tetra (4-aminophenyl) porphyrin (tapph2) Qiyue supply
- Top ten Devops best practices worthy of attention in 2022
- [high concurrency] deeply analyze the callable interface
- The easiest GUI to compile: dgui
- Easy to get started naturallanguageprocessing series topic 7 text classification based on fasttext
猜你喜欢

Output various graphics and text on the console through C #

HTTP Caching Protocol practice

Slot

2-nitro-5,10,15,20-tetra (3,5-dimethoxyphenyl) porphyrin (no2tdmpp) H2) /5,10,15,20-tetra (4-methylphenyl) porphyrin (TMPP) H2) Qiyue porphyrin products

Research Report on the new energy industry of recommended power equipment in 2022 industry development prospect market investment analysis (the attachment is a link to the network disk, and the report

Analysis report on the investment market of the development planning prospect of the recommended NFT industry research industry in 2022 (the attachment is a link to the online disk, and the report is

Annual inventory review of Alibaba cloud's observable practices in 2021

Quickly write MVVM code using source generators

机器人强化学习——Transferring End-to-End Visuomotor Control from Simulation to RealWorld (CoRL 2017)
![ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience](/img/fd/4c24e10fc91a7ce7e709a0874ba675.jpg)
ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience
随机推荐
Structure training camp module II operation
Meso tetra (4-N, N, n-trimethylaminophenyl) porphyrin (ttmapp) /meso tetra - [4- (BOC threonine) aminophenyl] porphyrin (TAPP thr BOC) supplied by Qiyue
2022-01 Microsoft vulnerability notification
Ctrip launched the "3+2" office mode. Are you sour?
CCTV revealed that xumengtao won the black Technology: there was a virtual coach???
嵌入式RTOS
Blip: conduct multimodal pre training with cleaner and more diverse data, and the performance exceeds clip! Open source code
想问问,券商选哪个比较好尼?本人小白不懂,现在网上开户安全么?
Leetcode notes on question brushing (XIV) -- related topics of binary tree attributes in binary tree chapter
data management plan
Research Report on recommended specialized, special and new industries in 2022 industry development prospect and market investment analysis (the attachment is a link to the online disk, and the report
What has urbanization brought to our mental health and behavior?
The first commercial spacewalk of mankind is finalized! Musk SpaceX announced a new round of space travel plan, and the American rich became repeat customers
Awk of shell script
Software architecture experiment summary
HTTP Caching Protocol practice
C語言用 printf 打印 《愛心》《火星撞地球》等,不斷更新
2022 recommended property management industry research report industry development prospect market investment analysis (the attachment is the link to the online disk, and the report is continuously up
开启生态新姿势 | 使用 WordPress 远程附件存储到 COS
Tcapulusdb Jun · industry news collection (V)