摘要:Mid-termPaper代写-Course: Computer Programming Course: Computer Programming I
Lecturer: Weigang Wu
Page 1 of 2
Mid-term Exam (B)
Mid-termPaper代写Course: Computer Programming I
Lecturer: Weigang Wu
Page 1 of 2
Mid-term Exam (B)
Date: 2010/11/10 Venue: A402, East Campus, SYSU
Time: 8:00-8:45am, 45mins Type: Close-book Total Points: 100
I. Multiple Choices (60 points, 3 for each blank)
1. Computer programs are ______________ to the computers
A) hearts B) instructions C) brains D) sequences
2. A computer internally uses _____________ to represent data.
A) zeros and ones B) ten digits (zero to nine) C) octal number system D) digits and characters
3. _________translates a high-level language program to a machine language program.
A) The operating system B) The CPU C) A Compiler D) A linker
4. A good programming style is important NOT because ____________
A) it makes a program run faster
B) it makes the program easy to read
C) it helps avoid errors
D) it makes the program compiled faster
5. Which of the following is a valid identifier?___________
A) _32 B) a?b C) main d) 3d
6. Which of the following descriptions is NOT correct?________
A) A named constant is the same as a variable except that its value cannot be changed.
B) According to the C++ standard, an identifier in C++ can have at most 31 characters.
C) A variable must be declared before it can be used.
D) The sizeof operator returns the size in bytes, not bits.
7. Which of the following expressions has the result 1? ________
A) 3%5 B) 10.001/10 C) 5/3 D) 3>5
8. The result of the expression “(int)(76.456*100)/100.0” is ________
A) 76 B) 76.45 C) 76.5 D) 76.456
9. Suppose char b = „d‟-1; int i = b + 2; the output of “cout<<i-„a‟<<endl;” is ________
A) 2 B) 3 C) 4 D) 5
10. To assign the character 5 to a variable x, you can use ________
A) char x = “5”; B) char x = = 5 C) char x = “\5” D) char x = „5‟
11. Suppose “int a=1,b=2,c=4;” after (c=a!=b)&&(a= =b)&&(c=b),the values of a, b and c are ______
A) 1, 2, 1 B) 1, 2, 0 C) 1, 2, 2 D) 1, 2, 3
12. Suppose x=10 and y =11, what is x after “((x=y)>=10)||(x++>10)”_______
A) 10 B) 11 C) 12 D) 1
13. How many times of type conversions will occur in the following statements? ________
double x = 5.4; float y = (int) x; int z = x;
A) 1 B) 2 C) 3 D) 4
14. Which of the following statement prints “csA\mid-term\paper.doc”_________
A) cout<<“csA\mid-term\paper.doc”;
B) cout<< “csA”\”mid-term”\”paper.doc”;
C) cout<< “csA\\mid-term\\paper.doc”;
D) cout<< “csA\mid-term\paper\.doc”;
15. With the statement x=5+(c=7), x has a value of _________
A) 5 B) 6 C) 7 D) 12
Student No.:
Student Name:
Score:
Course: Computer Programming I
Lecturer: Weigang Wu
Page 2 of 2
16. int j, i=1; j=i++; j++; then we have i of value _____
A) 1 B) 2 C) 3 D) 4
17. int i, a; i=(a=2*3, a*5), a+6; the value of i is_________
A) 6 B) 12 C) 30 D) 36
18. Which of the following descriptions is correct?________
A) The if-else statements can be converted to switch statements equivalently.
B) The selection statements can be converted to loop statements equivalently.
C) Each “if” must have an “else” to match it.
D) Floating-point numbers cannot be compared at all.
19. Which of the following descriptions is correct?________
A) The “do-while” loop can only be used for loops with unknown number of executions.
B) “for” loop is betters than “while”.
C)
本论文由英语论文网提供整理,提供论文代写,英语论文代写,代写论文,代写英语论文,代写留学生论文,代写英文论文,留学生论文代写相关核心关键词搜索。