freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

c程序設(shè)計(jì)與應(yīng)用基礎(chǔ)第五章多態(tài)性習(xí)題答案(已修改)

2025-01-26 20:52 本頁(yè)面
 

【正文】 第五章 多態(tài)性填空題1)在一個(gè)成員函數(shù)內(nèi)調(diào)用一個(gè)虛函數(shù)時(shí),對(duì)該虛函數(shù)的調(diào)用進(jìn)行___動(dòng)態(tài)______聯(lián)編。2)動(dòng)態(tài)聯(lián)編是在__虛函數(shù)___的支持下實(shí)現(xiàn)的,它通過___指針和引用__來調(diào)用該函數(shù)操作。3)下列程序的運(yùn)行結(jié)果如下:Base39。s cons.Derived39。s cons.Derived39。s des.Base39。s des.根據(jù)結(jié)果將程序補(bǔ)充完整。incude class Base{public:Base(){coutBase39。s cons.endl。}___varitual ~Base()___{coutBase39。s des.endl。}}。class Derived:public Base{public:Derived(){coutDerived39。s cons.endl。}~Derived(){coutDerived39。s des.endl。}}。void main(){Base *Ptr=___new Derived;__delete ptr。}4)C++中__不支持___虛構(gòu)造函數(shù),但__支持___虛析構(gòu)函數(shù)5)帶有__純虛函數(shù)___的類稱為抽象類,它只能作為___基類___來使用。6)下列程序的運(yùn)行結(jié)果如下:Derive139。s Print() called.Derive239。s Print() caIIed.根據(jù)結(jié)果將程序補(bǔ)充完整。include class Base{public:Base(int I){b=I。}_____vitual void print ()______protected:int b。}class Derive1:public Base{public:_____Derivel1(int I):Base(I){}______void Print(){coutDerive139。s Print() called.endl。 }}。class Derive2:public Base{______Derivel2(int I):Base(I){}void Print(){coutDerive139。s Print() called.endl。 }______}。void fun(______Base* Obj______){objPrint()。}。void main(){______Dervel1* d1=new Dervel1(1); Dervel2* d1=new Dervel2(2);______fun(d1)。fun(d2)。}編程題1)設(shè)計(jì)一個(gè)小型公司的人員信息管理系統(tǒng)。該公司主要有四類人員:經(jīng)理、兼職技術(shù)人員、銷售經(jīng)理和兼職推銷員。要求存儲(chǔ)這些人員的姓名、編號(hào)、級(jí)別、當(dāng)月薪水總額并顯示全部信息,具體要求如下所述。___①___人員編號(hào)基數(shù)為1000,每輸入一個(gè)人員信息,編號(hào)順序加1。___②___程序具有對(duì)所有人員提升級(jí)別的功能。經(jīng)理為4級(jí),兼職技術(shù)人員和銷售經(jīng)理為3級(jí),推銷員為1級(jí)。___③___月薪計(jì)算方法是:經(jīng)理拿固定月薪8000元;兼職技術(shù)人員按每小時(shí)100元領(lǐng)取月薪;兼職推銷員的月薪按該推銷員當(dāng)月銷售額的4%提成;銷售經(jīng)理既拿固定月薪也領(lǐng)取銷售提成,固定月薪為5000元,銷售提成為所管轄部門當(dāng)月銷售額的5‰。答案:include include class employee{public: employee()。 ~employee(){delete[] name。} virtual void pay()=0。 virtual void promote(int increment=0){grade+=increment。} virtual void display()=0。protected: char *name。 int no。 int grade。 double Pay。 static int MaxNo。}。class technician:public employee{publi
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號(hào)-1