作者jeremiah7932 (犬一同学)
看板NTU-Exam
标题[试题] 97上 林达德 计算机程式语言 第一次小考
时间Thu Nov 6 19:09:54 2008
课程名称︰计算机程式语言
课程性质︰大一必修
课程教师︰林达德
开课学院:生农学院
开课系所︰生物产业机电工程学系
考试日期(年月日)︰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
1F:推 NBASCIDM :你也太快了吧 11/06 19:14
2F:→ ilway25 :觉得第5题可议.. do{break;a++;}while(a); 11/06 20:59
3F:推 nvidia2370 :XD 11/07 02:39
※ lldavuull:转录至看板 NTUBIME102HW 11/24 13:28
※ fanif:转录至看板 NTUBIME104HW 11/09 15:13