版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、專業(yè)好文檔廣播電視大學c+語言程序設計模擬試題2001年元月題 號一二三四五總 分分 數(shù)評卷人得分 一、填空(每空2分,共20分) 參考答案1.c+源程序文件擴展名為_。2.unsigned long 型數(shù)據(jù)占_字節(jié)存儲空間。3.執(zhí)行語句coutd:datac+test.exe;后,輸出結果是_。4.表達式8|3的結果是_。5.全局變量和_若在定義時未進行初始化,則自動初始化為0。6.將s初始化為值是hello!的指針常量,初始化語句是_。7.類中的成員只能為該類的成員函數(shù)及該類的派生類中的成員函數(shù)訪問,則應加上訪問屬性_。8.定義輸出文件流f,并以追加數(shù)據(jù)方式打開相應文件a:aaa.dat,
2、定義f的語句是_。9.設文件f.cpp中的一個函數(shù)要訪問在另一個文件中定義的int型變量x,則在f.cpp中x應定義為_。10.函數(shù)模板的說明格式是:template_函數(shù)定義。評卷人得分二、單項選擇題(每空2分,共20分)參考答案1.類型修飾符unsigned修飾( )類型是錯誤的。 a char b int c long int d float2.下列變量名中,( )是合法的。 a _var b bye-bye c int d 123_cc3.設int a=3,* p=&a;,則*p的值是( )。 a 變量a的地址值 b 無意義 c 變量p的地址值 d 34.設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ù)據(jù) 方式打開文件的。 a in b out c app d ate7.類x中,若沒有定義構造函數(shù),則默認的構造函數(shù)是( )。 a x ( ) b x (x & x) *this=x; c x ( ) d 不存在8.設int * p2=&x,* p1=a;*p2=*b;則變量a和b的類型
4、分別是( )。 a int和int b int * 和int c int和int * d int * 和int *9.設p為指針變量,則以下表達式正確的是( )。 a -p+ b -+p c -(p+5) d (p-5)+ 10.設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);評卷人得分三、回答問題(每題4分,共20分)參考答案1.設int a34;double b345; 請寫出數(shù)組指針pa和pb的定義,使其分別與數(shù)組名a和b等價。2.
5、設int f1(int n,char * s);char * f2(int n,char * s); 請寫出函數(shù)指針pf1和pf2的定義,使其分別指向上述兩個函數(shù)。3.請初始化一維指針數(shù)組week。其初值表初值為sun,mon,tue,wed,thu,fri和sat。 4.要使語句p1=new int(10) ;p2=new double 10;能正常執(zhí)行,寫出p1和p2的定義。 5.設有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; 寫出結果。評卷人得分四、(每題10分,共20分)參考答案1.寫出下列程序的執(zhí)行結果。 # 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.設a盤上文本文件aaa.dat中保存有0至100之間的所有奇數(shù),下列程序?qū)⑷繑?shù)據(jù)及其和輸出至屏幕上,請將程序補充完全。 # 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._; 評卷人得分五、(每題10分,共20分)參考答案1.用while循環(huán)編程,求自然數(shù)1至100之間各奇數(shù)平方和并輸出。2.設有函數(shù)void sum(int score 5,int row);,它將數(shù)組score每行后四個元素之和用首元素保存。試編寫這個函數(shù) 編寫主函數(shù)并初始化相應實參調(diào)用這個函數(shù),并輸出結果。關閉窗口廣播電視大學c+語言程序設計模擬試題答案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.二、單項選擇題(每空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; 關閉窗口 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等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年廣東省深圳市中考英語試題含解析
- 長春版小學心理健康教育四年級(下)教案
- 期中提優(yōu)卷(無答案) 2024-2025學年人教版(2024)英語七年級上冊
- 2024至2030年中國控油潔面奶數(shù)據(jù)監(jiān)測研究報告
- 2024至2030年中國帶座軸承用潤滑脂行業(yè)投資前景及策略咨詢研究報告
- 2024至2030年中國室內(nèi)繡花拖鞋數(shù)據(jù)監(jiān)測研究報告
- 2024至2030年中國口咽通氣管數(shù)據(jù)監(jiān)測研究報告
- 2024至2030年中國單刃電動茶樹修剪機數(shù)據(jù)監(jiān)測研究報告
- 產(chǎn)品英語術語培訓
- 2024至2030年中國2,2-二甲基聯(lián)苯胺鹽酸鹽行業(yè)投資前景及策略咨詢研究報告
- 夫妻離婚協(xié)議書電子版
- 對外投資合作國別(地區(qū))指南 -坦桑尼亞-20240529-00493
- 人教版高中物理必修一全書綜合測評(解析版) 同步練習
- 2024年保密教育線上培訓考試題目含答案【模擬題】
- 風電項目居間合同
- 2024年安徽警官職業(yè)學院單招職業(yè)適應性測試題庫完美版
- 中西醫(yī)方法論比較研究兼論中醫(yī)的科學性
- 中醫(yī)醫(yī)療技術管理制度
- 專職集體協(xié)商指導員崗位
- 2024年度全新實習生協(xié)議錄用模板下載
- 編譯原理課后答案(第三版蔣立源康慕寧編)
評論
0/150
提交評論