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

正文內(nèi)容

c上機(jī)實(shí)驗(yàn)報告-資料下載頁

2024-10-19 08:53本頁面
  

【正文】 。a=ac?a:c。return a。} void main(void){ int a。double b。a=max1(1,2)。coutLab3_3: include using namespace std。int max1(int a,int b){ a=ab?a:b。return a。} int max1(int a,int b,int c){ a=ab?a:b。a=ac?a:c。return a。}int main(){ int i,j,k。cout”2131415public: Rank rank。int frequency。float voltage。CPU(Rank r,int f,float v){//構(gòu)造函數(shù)coutrank=r。frequency=f。voltage=v。} void run(){cout} void stop(){coutcoutcoutcout}。int main(){ CPU cpu(p5,500,2000)。()。()。()。return 0。}Lab4_2 include using namespace std。enum Rank{p1=1,p2,p3,p4,p5,p6,p7}。//CPU類 class CPU{ public://析構(gòu)函數(shù)17puter(Rank r,int f,float v){CPU cpu(r,f,v)。//定義CPU對象RAM ram(1)。//定義RAM對象CDROM cdrom(1)。//定義CDROM對象()。()。()。} }。int main(){ puter (p4,300,3000)。return 0。}實(shí)驗(yàn)七、繼承與派生(一、二)4學(xué)時實(shí)驗(yàn)?zāi)康模簩W(xué)習(xí)定義和使用類的繼承關(guān)系,定義派生類。熟悉不同繼承方式下對基類成員的訪問控制。學(xué)習(xí)利用虛基類解決二義性問題實(shí)驗(yàn)任務(wù) a)定義一個基類Animal,有私有整型成員變量age,構(gòu)造其派生類dog,在其成員函數(shù)SetAge(int n)中直接給age賦值,看看會有什么問題,把a(bǔ)ge改為公有成員變量,還會有問題嗎?編程試試看。b)定義一個基類BaseClass,有整型成員變量Number ,構(gòu)造其派生類DerivedClass,觀察構(gòu)造函數(shù)和析構(gòu)函數(shù)的執(zhí)行情況。c)定義一個車(vehicle)基類,具有MaxSpeed、Weight等成員變量,Run、Stop等成員函數(shù),由此派生出自行車(bicycle)類、汽車(motorcar)類。自行車類有高度(height)等屬性,汽車類有座位數(shù)(SeatNum)等屬性。從bicycle和motorcar派生出摩托車(motorcycle)類,在繼承過程中,注意把vehicle設(shè)置為虛基類。如果不把vehicle設(shè)置為虛基類,會有什么問題?編程試試看。實(shí)驗(yàn)步驟編寫程序定義基類Animal,成員變量age定義為私有的。構(gòu)造派生類dog,在其成員函數(shù)SetAge(int n)中直接對age賦值時,會出現(xiàn)類似以下的錯誤提示:error C2248:’age’:cannot access private member declared in class ‘Animal’error C2248:’age’:cannot access private member declared in class ‘Animal’把a(bǔ)ge改為公有成員變量后重新編譯就可以了。程序名為:0確方便我們編程。部分參考代碼Lab7_1 include using namespace std。class Animal{public: int age。}。class dog:public Animal{ public: int SetAge(int n){age=n。return age。} }。void main(void){ int age。dog d。age=(3)。coutLab7_2 include using namespace std。class BaseClass{ public: int Number。BaseClass(){coutcout//Motorcycle繼承bicycle和motorcar類class motorcycle:public bicycle,public motorcar{ public: motorcycle(int seat,double H,double MS,double W){SeatNum=seat。height=H。MaxSpeed=MS。Weight=W。} void show(){coutcoutcoutcoutint main(){ motorcycle che(3,500)。()。return 0。} 實(shí)驗(yàn)八、多態(tài)性2學(xué)時實(shí)驗(yàn)?zāi)康模赫莆者\(yùn)算符重載的方法習(xí)使用虛函數(shù)實(shí)現(xiàn)動態(tài)多態(tài)性。實(shí)驗(yàn)任務(wù)a)定義Point類,有坐標(biāo)x,y兩個成員變量;對Point類重載“++”、“”運(yùn)算符,實(shí)現(xiàn)對坐標(biāo)值的改變。定義一個車(vehicle)基類,有Run、Stop等成員函數(shù),由此派生出自行車(bicycle)類、汽車(motorcar)類,從bicycle和motorcar派生出摩托車(motorcycle)類,它們都有Run、Stop等成員函數(shù)。觀察虛函的作用。實(shí)驗(yàn)步驟編寫程序定義Point類,在類中定義整型的私有成員變量x,y,定義成員函數(shù)Pointamp。 operator++()。Point operator++(int)。以實(shí)現(xiàn)對Point類重載“++”運(yùn)算符,定義成函數(shù)Pointamp。 operator –()。Point operator也就是函數(shù)的重載。部分參考代碼Lab8_1 include using namespace std。class Point{ public: Point(double x=,double y=):xray(x),yray(y){} Point operator++(int)。Point operator(int)。void show()。private: double xray。double yray。}。Point Point::operator++(int){ return Point(xray++,yray++)。}Point Point::operator(int){ return Point(xray,yray)。}void Point::show(){ coutint main(){ Point p(,)。coutshow(amp。v)。return 0。}第五篇:上機(jī)實(shí)驗(yàn)報告格式請各位同學(xué)按照下列格式寫:否則按照0分記上機(jī)實(shí)驗(yàn)報告格式Matlab學(xué)習(xí)第?次上機(jī)實(shí)驗(yàn)報告(第?次)姓名:???班級:???上機(jī)時間:??????將文檔發(fā)到我的郵箱里面learn_matlab@
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1