




下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、。裝。訂。線。2006 年2007 年第 1 學(xué)期 計(jì)科 04面象程序設(shè)計(jì) 試卷 C 卷時(shí)間共 120 分鐘一、填空題(每題 2 分,共 10 分)填空題1、寫出一個(gè) C+的邏輯語(yǔ)句,如果 testScroe 的值大于或是等于 100,并且小于等于 200,則其取值為 true:(testScroe=100 &testScroe )。)控制結(jié)構(gòu)。2、3、4、使得某序列語(yǔ)句重復(fù)執(zhí)行的控制結(jié)構(gòu)稱為(循環(huán)在一個(gè)類中把另外一個(gè)類的一個(gè)對(duì)象定義為數(shù)據(jù)成員,這種機(jī)制稱為( 組合)。給出如下函數(shù),表達(dá)式 Func(2)的值是(14)。Func( /* in */if (n != 5)n ) return 3
2、 + Func(n + 1);elsereturn 5;5、在面象程序設(shè)計(jì)中,所謂的消息傳遞是指( 函數(shù)調(diào)用)。二、判斷題。把正確選項(xiàng)填入下面的表格的中,正確的標(biāo),錯(cuò)誤的標(biāo)。(每題 2 分,共 20 分)F There is only one unique general solution (algorithm) for a given problem. c1T A programming language is said to be (case sensitive) if it considers uppercase letters to be different from lowercas
3、e letters.T If a C+ If sement begins with if (age = 30), the If condition is an assignment expres, not a relational1、2、3、expres.4、5、F An infinioop is one in which the While expresalways has the value false.T The code segmentcout response;while (response != Y & response != N) cout response;is equival
4、ent to the following code segment. docout response; while (response != Y & response != N);6、 F In C+, the express beta+ and +beta cways be usederchangeably.7、 F A C+ class can have at most one constructor.8、 F In C+, two different classes-say, MyClass and YourClass-cannot both have member functions
5、named Subtract.題號(hào)12345678910111213得分閱卷人得分閱卷人題號(hào)12345678910總分得分閱卷人9、 T The components of an array are all of the same daype.10、F A sequential search on a sorted list cannot be made quickern one on an unsorted list.11、F An inheritance hierarchy gives a visual picture of has-a relationships.12、F In C+,
6、a derived classs constructor is executed before its base class constructor is executed.13、F Given the following recursive formula, the value of F(3) is 11.F(N) = 2 + F(N - 1), if N 1and F(N) = 5, if N = 1三、選擇題。把正確選項(xiàng)填入下面的表格的中。(每題 3 分,共 54 分)、 B Which of the following translates a program written in a
7、 high-level language code?o machineA. a mouseB. a compilerC. an operating systemD. an editor2、 CWhich of the following terms describes the repetition of sements (instructions) while certain conditions are met?A. sequenceB. selectionC. looD. subprogram3、 B Which of the following is a legal string ass
8、ignment?A. name = Jones;B. name = Jones;C. name = 123 + Jones;D. b and c above4、 B Givent x is a float variable and num is anvariable containing the value 5, what will x contain afterexecution of the following sement:x = num + 2;A. 7B. 7.0C. 5D. 5.0E. nothing; a compile-time error occurs5、 A Which o
9、f the following sements abo+ stream input is true?When anfloating-poWhen aneger data value is read form.eger data value is reado a float variable, the value isconvertedoo a float variable, the float variablees anvariable.C. It is an error to read aneger data valueo a float variable.D. Input of a flo
10、ating-poE. c and d abovedata value stops when a decimal pois encountered.6、 E After execution of the following code, what will be the value o cin angle;if (angle 5)angle = angle + 5; if (angle 2)angle = angle + 10;le if the input value is 10?A. 0B. 5C. 10D. 15E. 257、 D What is the value of loopCount
11、 after control exits the following loop? loopCount = 1;while (loopCount = 145) alpha = alpha + 7; loopCount+;A. 1B. 144C. 145D. 1468、 D Given the function headingvoid GetNums(howMany,float& alpha,float& beta)which of the following is a valid function prototype fetNums?A. void GetNums(howMany, float&
12、 alpha, float& beta );B. void GetNums(, float&, float& );C.GetNums(, float&, float& );D. a and b aboveE. a, b, and c above題號(hào)12345678910111213得分閱卷人9、 C What is the output of the following code fragment? (beta is of type beta = 5;doswitch (beta)case 1 : cout R;break;case 2 :case 4 : cout O;break; case
13、 5 : cout 1); cout X;.)A. XB. ROOLXC. LOOXD. LOORXE. ROOX10、25.B What is the output of the following code fragment?string msg = HELP; cout msg2;A. EB. LC. HED. HELPHELPE. none of the above11、A Given the class declaration class MyClasspublic:.void Func(); private:n;what noion does the body of Func us
14、e to assign the value 3 to n?A. n = 3;B. MyCla= 3;C. MyClass:n = 3;D. someObject.n = 3;E. It cant be done-n is private.12、E A class SomeClass has a member function Fs no parameter list, returns anvalue, correctand does not modify any of the private data.Which of the following would be the function d
15、efinition for F?F() const .A.B. constF() .C. SomeClass:F() const .D. constSomeClass:F() .E.SomeClass:F() const .13、22.D Given the declarationlistVals7 = 10, 15, 20, 25, 30, 35, 40;a binary search is used to search the list for the value 35. In each iteration of the search loop, the index variablesmi
16、ddle, and last define the range of items being searched. When the search is finished, what is the value of,?(RememberA. 0t C+ arrays begin at index 0.)B. 2C. 3D. 4E. 514、20.D Consider the following C+ class declarations: class Xpublic:void Func1(); void Func2();private:m;class Y : public X public:vo
17、id Func3(); private:float f;How many public members does class Y have?A.0B.1C.2D.3E.415、24.B Supet class X has a class membert is an object of another class Y. If classes X and Y bothhave constructors, in what order will the constructors be executed when an object of class X is created?A.Xs construc
18、tor is executed, then Ys.B.Ys constructor is executed, then Xs.C.Both constructors are executed at the same time.E.Only Ys constructor is executed.D.Only Xs constructor is executed.16、27.A Supet a C+ class D is derived from a base class B. Class B has a public member function Func()t is not declared
19、 to be virtual, and class D reimplements Func(). At execution time, supe passed to the following function:void DoSomething( B& x ) x.Func();t a D object isWithhe DoSomething function, whose verof Func() is called?and b aboveA.Bs ver17、B In theB.Ds verC.boD.neither a nor b aboveobject-oriented design of an airline passenger reservation program, supet airplane seat,aisle seat, and window seat have been identified as objects. Focusing specifically on the aisle seat object,how does it relate to the airplaa
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年山東省煙臺(tái)市芝罘區(qū)中考二??荚囌Z(yǔ)文試題含答案
- 2025年員工三級(jí)安全培訓(xùn)考試試題附答案(培優(yōu))
- 25年公司安全管理人員安全培訓(xùn)考試試題附參考答案【預(yù)熱題】
- 2024-2025公司職工安全培訓(xùn)考試試題(答案)
- 2025新版車間安全培訓(xùn)考試試題新
- 四川省廣元市旺蒼縣重點(diǎn)達(dá)標(biāo)名校2024-2025學(xué)年初三第二學(xué)期期末四校聯(lián)考語(yǔ)文試題含解析
- 建東職業(yè)技術(shù)學(xué)院《藥劑學(xué)實(shí)驗(yàn)》2023-2024學(xué)年第一學(xué)期期末試卷
- 蘇州市振華中學(xué)2024-2025學(xué)年初三下五校聯(lián)考生物試題含解析
- 江西省樂(lè)平市2025屆初三寒假模擬(四)英語(yǔ)試題試卷含答案
- 江西現(xiàn)代職業(yè)技術(shù)學(xué)院《室內(nèi)系統(tǒng)設(shè)計(jì)》2023-2024學(xué)年第二學(xué)期期末試卷
- 租電動(dòng)車電子合同協(xié)議
- 福建省漳州地區(qū)校聯(lián)考2024-2025學(xué)年七年級(jí)下學(xué)期期中考試語(yǔ)文試卷(含答案)
- 2025年便利店店員勞動(dòng)合同
- GB/T 196-2025普通螺紋基本尺寸
- 2025年陜西省漢中市寧強(qiáng)縣中考一模道德與法治試題(含答案)
- 工地分紅合同協(xié)議
- 變配電工多選試題及答案
- 零售業(yè)智能轉(zhuǎn)型:DeepSeek驅(qū)動(dòng)的消費(fèi)行為分析與推選系統(tǒng)
- 招商引資知識(shí)培訓(xùn)課件
- 2025-2030中國(guó)菊粉提取物行業(yè)市場(chǎng)發(fā)展趨勢(shì)與前景展望戰(zhàn)略研究報(bào)告
- 商務(wù)英語(yǔ)中的語(yǔ)用失誤分析論文
評(píng)論
0/150
提交評(píng)論