[試題] 97上 林達德 計算機程式語言 第二次小考

看板NTU-Exam作者 (犬一同學)時間15年前 (2008/11/06 19:09), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串1/1
課程名稱︰計算機程式語言 課程性質︰大一必修 課程教師︰林達德 開課學院:生農學院 開課系所︰生物產業機電工程學系 考試日期(年月日)︰97/11/06 考試時限(分鐘):12分鐘 是否需發放獎勵金:是 (如未明確表示,則不予發放) 試題 : Multiple choice Identify the letter of the choice that best completes the statement or answer the Question. 1.The only requirement in creating more thean one function with the same name is that the compiler must be able to determine which function to use on the basis of the ˍˍ of the parameters. a. length c. usability b. complexity d. data type 2.A function returning a value must specify, in its header line, the ˍˍ of the value that will be returned. a. size c. address b. data type d. use 3.Within the parentheses of the for statement are ˍˍ items separated by semicolons. a. 2 c. 4 b. 3 d. 5 4.A repetition statement continues looping until the expression evaluates to  ˍˍ. a. zero c. two b. one d. any nonzero value 5.All statements in a do loop are executed at least ˍˍ. a. once c. three times b. twice d. four times 6.The declaration statement for a function os referred to as a function ˍˍ. a. specification c. declaration b. initialization d. prototype Numeric Response Find the mumeric value of the variables or program output after the program statements are executed. 7.What is the value stored in int count afer the following statements are executed? int count=0; for(int i=0;i<10;i++) count=count+3; ANSWER:30 8.What is the output of this program after it is executed? #include<iostream> using namespace std; int myFunc(int x); int main() { int z=10; myFunc(z); return 0; } int myFunc(int x) { cout << "The number is: " <<x; return x; } ANSWER:The number is: 10 9.What is the value stored in int score after the following statements are executed? int score=0; do { score=score+10; }while(score<=100); ANSWER:110 10.What is the value stored in int num after the following statements are executed? int num=10; while (num<30) { num=num+5; } ANSWER:30 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.240.162

11/06 19:14, , 1F
你也太快了吧
11/06 19:14, 1F

11/06 20:59, , 2F
覺得第5題可議.. do{break;a++;}while(a);
11/06 20:59, 2F

11/07 02:39, , 3F
XD
11/07 02:39, 3F
lldavuull:轉錄至看板 NTUBIME102HW 11/24 13:28 fanif:轉錄至看板 NTUBIME104HW 11/09 15:13
文章代碼(AID): #194j249W (NTU-Exam)