版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、專業(yè)好文檔廣播電視大學(xué)c+語言程序設(shè)計(jì)模擬試題2001年元月題 號(hào)一二三四五總 分分 數(shù)評(píng)卷人得分 一、填空(每空2分,共20分) 參考答案1.c+源程序文件擴(kuò)展名為_。2.unsigned long 型數(shù)據(jù)占_字節(jié)存儲(chǔ)空間。3.執(zhí)行語句coutd:datac+test.exe;后,輸出結(jié)果是_。4.表達(dá)式8|3的結(jié)果是_。5.全局變量和_若在定義時(shí)未進(jìn)行初始化,則自動(dòng)初始化為0。6.將s初始化為值是hello!的指針常量,初始化語句是_。7.類中的成員只能為該類的成員函數(shù)及該類的派生類中的成員函數(shù)訪問,則應(yīng)加上訪問屬性_。8.定義輸出文件流f,并以追加數(shù)據(jù)方式打開相應(yīng)文件a:aaa.dat,
2、定義f的語句是_。9.設(shè)文件f.cpp中的一個(gè)函數(shù)要訪問在另一個(gè)文件中定義的int型變量x,則在f.cpp中x應(yīng)定義為_。10.函數(shù)模板的說明格式是:template_函數(shù)定義。評(píng)卷人得分二、單項(xiàng)選擇題(每空2分,共20分)參考答案1.類型修飾符unsigned修飾( )類型是錯(cuò)誤的。 a char b int c long int d float2.下列變量名中,( )是合法的。 a _var b bye-bye c int d 123_cc3.設(shè)int a=3,* p=&a;,則*p的值是( )。 a 變量a的地址值 b 無意義 c 變量p的地址值 d 34.設(shè)int m=0;,下列表示引
3、用的方法中,( )是正確的。 a int &x=m; b int &y=10; c int &z; d float &t=&m5.循環(huán)for(int i=0,x=0;!x&i=5;i+);的循環(huán)體執(zhí)行次數(shù)是( )。 a 5 b 6 c 1 d 無限 6.磁盤文件操作時(shí),在打開磁盤文件的訪問方式中,( )是以追加數(shù)據(jù) 方式打開文件的。 a in b out c app d ate7.類x中,若沒有定義構(gòu)造函數(shù),則默認(rèn)的構(gòu)造函數(shù)是( )。 a x ( ) b x (x & x) *this=x; c x ( ) d 不存在8.設(shè)int * p2=&x,* p1=a;*p2=*b;則變量a和b的類型
4、分別是( )。 a int和int b int * 和int c int和int * d int * 和int *9.設(shè)p為指針變量,則以下表達(dá)式正確的是( )。 a -p+ b -+p c -(p+5) d (p-5)+ 10.設(shè)void f1(int &x,char * p);int m;char s =c+;以下調(diào)用合法的是( )。 a f1(&m,&s); b f1(&m,s); c f1(m,s); d f1(m,&s);評(píng)卷人得分三、回答問題(每題4分,共20分)參考答案1.設(shè)int a34;double b345; 請(qǐng)寫出數(shù)組指針pa和pb的定義,使其分別與數(shù)組名a和b等價(jià)。2.
5、設(shè)int f1(int n,char * s);char * f2(int n,char * s); 請(qǐng)寫出函數(shù)指針pf1和pf2的定義,使其分別指向上述兩個(gè)函數(shù)。3.請(qǐng)初始化一維指針數(shù)組week。其初值表初值為sun,mon,tue,wed,thu,fri和sat。 4.要使語句p1=new int(10) ;p2=new double 10;能正常執(zhí)行,寫出p1和p2的定義。 5.設(shè)有int f1(int n)n+=2;return n*n; int f2(int &n)n+=2;return n*n; 執(zhí)行 int m=5,n=3; m=f1(n);coutm nendl; m=f2(n
6、);coutm nendl; 寫出結(jié)果。評(píng)卷人得分四、(每題10分,共20分)參考答案1.寫出下列程序的執(zhí)行結(jié)果。 # include void main() int i=1,j=2,k=3,a=10; if (!i) a-; else if(j) if(k) a=5; else a=6; a+; coutaendl; if(ij) if(i!=3) if(!k) a=1; else if(k) a=5; a+=2; coutaendl; 2.設(shè)a盤上文本文件aaa.dat中保存有0至100之間的所有奇數(shù),下列程序?qū)⑷繑?shù)據(jù)及其和輸出至屏幕上,請(qǐng)將程序補(bǔ)充完全。 # include # inc
7、lude _ void main(void) _ f1(a:aaa.dat,ios:in|ios:nocreate); if (!f1) cerra:aaa.dat file not open!x;coutx ;_; f1._; 評(píng)卷人得分五、(每題10分,共20分)參考答案1.用while循環(huán)編程,求自然數(shù)1至100之間各奇數(shù)平方和并輸出。2.設(shè)有函數(shù)void sum(int score 5,int row);,它將數(shù)組score每行后四個(gè)元素之和用首元素保存。試編寫這個(gè)函數(shù) 編寫主函數(shù)并初始化相應(yīng)實(shí)參調(diào)用這個(gè)函數(shù),并輸出結(jié)果。關(guān)閉窗口廣播電視大學(xué)c+語言程序設(shè)計(jì)模擬試題答案2001年元月一
8、、填空(每空2分,共20分) 返回1.cpp2.43.d:datac+test.exe4.115.靜態(tài)局部變6.char * const s=hello!;7.protected8.ofstream f(a:aaa.dat,ios:app);9.extern int x;10.二、單項(xiàng)選擇題(每空2分,共20分)返回1d2a3d4a5b6c7a8d9b10c三、回答問題(每題4分,共20分)返回1int (*pa)4=a;double(*pb)45=b;2int (* pf1)(int n,char * s)=f1;char *( * pf2)(int n,char * s)=f2; 3cha
9、r * week=sun,mon,tue,wed,thu,fri,sat; 4int * p1 ;double * p2;5 25 36 25 5四、(每題10分,共20分)返回1 6 7 2 fstream.h ifstream !f1.eof() s+=x close()五、(每題10分,共20分)返回1 #includevoid main()int i=1,sum=0;while(i=100)sum+=i*i;i+=2;coutsum=sumendl; 2#includevoid sum(int score5,int row) for(int i=0;irow;i+) scorei0=0
10、; for(int j=1;j=4;j+) scorei0+=scoreij; void main() int a55=0,50,60,70,80,0,51,61,71,81, 0,52,62,72,82,0,53,63,73,83,0,54,64,74,84; sum(a,5); for(int i=0;i5;i+) coutai0endl; 關(guān)閉窗口 if we dont do that it will go on and go on. we have to stop it; we need the courage to do it.his comments came hours afte
11、r fifa vice-president jeffrey webb - also in london for the fas celebrations - said he wanted to meet ivory coast international toure to discuss his complaint.cska general director roman babaev says the matter has been exaggerated by the ivorian and the british media.blatter, 77, said: it has been d
12、ecided by the fifa congress that it is a nonsense for racism to be dealt with with fines. you can always find money from somebody to pay them.it is a nonsense to have matches played without spectators because it is against the spirit of football and against the visiting team. it is all nonsense.we c
13、an do something better to fight racism and discrimination.this is one of the villains we have today in our game. but it is only with harsh sanctions that racism and discrimination can be washed out of football.the (lack of) air up there watch mcayman islands-based webb, the head of fifas anti-racism
14、 taskforce, is in london for the football associations 150th anniversary celebrations and will attend citys premier league match at chelsea on sunday.i am going to be at the match tomorrow and i have asked to meet yaya toure, he told bbc sport.for me its about how he felt and i would like to speak t
15、o him first to find out what his experience was.uefa hasopened disciplinary proceedings against cskafor the racist behaviour of their fans duringcitys 2-1 win.michel platini, president of european footballs governing body, has also ordered an immediate investigation into the referees actions.cska sa
16、id they were surprised and disappointed by toures complaint. in a statement the russian side added: we found no racist insults from fans of cska.baumgartner the disappointing news: mission aborted.the supersonic descent could happen as early as sunda.the weather plays an important role in this missi
17、on. starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. the balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. it will climb
18、higher than the tip of mount everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. as he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.the balloon will
19、slowly drift to the edge of space at 120,000 feet ( then, i would assume, he will slowly step out onto something resembling an olympic diving platform.below, the earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. still, hell be traveling fast, so despite
20、 the distance, it will not be like diving into the deep end of a pool. it will be like he is diving into the shallow end.skydiver preps for the big jumpwhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to earth. but this will not be enough to stop him completely.if he
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 05J909《工程做法》(標(biāo)準(zhǔn)圖集)
- 陽江2024年廣東陽江市消防救援支隊(duì)第十三批政府專職消防員(江城)招錄筆試歷年典型考點(diǎn)(頻考版試卷)附帶答案詳解版
- 醬油品牌營(yíng)銷案例分析考核試卷
- 水資源優(yōu)化配置策略-第1篇-洞察分析
- 微生物資源利用-洞察分析
- 物體殘留與口腔癌風(fēng)險(xiǎn)-洞察分析
- 異步寄存器研究進(jìn)展-洞察分析
- 音樂制作產(chǎn)業(yè)鏈分析-洞察分析
- 財(cái)務(wù)部門職能職責(zé)
- 移動(dòng)寬帶設(shè)備批發(fā)動(dòng)態(tài)-洞察分析
- 初三語文總復(fù)習(xí)全程計(jì)劃表
- 電子技術(shù)基礎(chǔ)與技能-機(jī)工教案第九章教案555集成定時(shí)器介紹
- 污水處理運(yùn)行質(zhì)量保證措施
- 食材供貨及質(zhì)量保障措施方案
- 基于單片機(jī)的智能充電器設(shè)計(jì)
- 營(yíng)養(yǎng)學(xué)概論演示
- 統(tǒng)編版語文四年級(jí)上冊(cè)期末總復(fù)習(xí)課件
- 2023年四川省鄉(xiāng)村醫(yī)生招聘筆試題庫(kù)及答案解析
- 彈力重力和摩擦力
- 配料罐(攪拌罐)說明書
- 【超星爾雅學(xué)習(xí)通】《中國(guó)近現(xiàn)代史綱要(首都師范大學(xué))》章節(jié)測(cè)試題及答案(一)
評(píng)論
0/150
提交評(píng)論