




下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、。裝。訂。線。2006 年2007 年第 1 學期 計科 04面象程序設計 試卷 C 卷時間共 120 分鐘一、填空題(每題 2 分,共 10 分)填空題1、寫出一個 C+的邏輯語句,如果 testScroe 的值大于或是等于 100,并且小于等于 200,則其取值為 true:(testScroe=100 &testScroe )。)控制結構。2、3、4、使得某序列語句重復執(zhí)行的控制結構稱為(循環(huán)在一個類中把另外一個類的一個對象定義為數(shù)據(jù)成員,這種機制稱為( 組合)。給出如下函數(shù),表達式 Func(2)的值是(14)。Func( /* in */if (n != 5)n ) return 3
2、 + Func(n + 1);elsereturn 5;5、在面象程序設計中,所謂的消息傳遞是指( 函數(shù)調(dià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.題號12345678910111213得分閱卷人得分閱卷人題號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三、選擇題。把正確選項填入下面的表格的中。(每題 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題號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. 本站所有資源如無特殊說明,都需要本地電腦安裝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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 房產(chǎn)管理面試題及答案
- 輕工心理測試題及答案
- 廚房消防安全培訓課件
- 支氣管肺炎的護理查房
- 背部燒傷護理查房
- 2025年 黑龍江公務員考試模擬試卷附答案
- 中外教育簡史考析
- 2025年中國女式外套和夾克行業(yè)市場全景分析及前景機遇研判報告
- 中醫(yī)內(nèi)科眩暈診療要點解析
- 中級社工師綜合能力培訓
- 種子萌發(fā)過程中的生物化學動態(tài)研究
- 浙江省普通高中學業(yè)水平合格性考試歷史試題(解析版)
- 創(chuàng)客中國創(chuàng)業(yè)比賽商業(yè)BP項目計劃書模板(標準邏輯直接套用)
- 人教版音樂一年級下冊《第18課 勤快人和懶惰人》教案
- 院感知識手衛(wèi)生知識培訓
- 2025年廣東省深圳市初中地理中考學業(yè)水平考試模擬卷(二)(含答案)
- 休克診療指南規(guī)范2025
- 2024年遼寧省普通高等學校招生錄取普通類本科批(物理學科類)投檔最低分
- 保安培訓考試內(nèi)容解析及試題及答案
- 電梯維護保養(yǎng)服務投標文件(技術方案)
- 2025年中國PCR儀市場全面調(diào)研及行業(yè)投資潛力預測報告
評論
0/150
提交評論