?? ssd6-choice.txt
字號:
(a) II and III only
(b) I and III only
(c) I only
(d) III only
Correct answer is (d)
Your score on this question is: 0.00
Feedback:
See section 1.3.3 of the course notes.
--------------------------------------------------------------------------------
11.
Programs compiled for an Intel Pentium processor do not execute properly on a SPARC processor from Sun Microsystems because
(a) copyrights regarding code cannot be violated
(b) the assembly mnemonics for the same "opcode" are different in the two processors
(c) the memory of a SPARC CPU is numbered from top to bottom
(d) the operation codes understood by the two processors are different
Correct answer is (d)
Your score on this question is: 7.14
Feedback:
See section 1.5.1 of the course notes.
--------------------------------------------------------------------------------
12.
The program counter contains
(a) the address of the CPU instruction that is about to be executed
(b) the number of CPU instructions a program has executed so far
(c) the amount of memory a program is currently using
(d) the number of times a program has been executed
Correct answer is (a)
Your score on this question is: 0.00
Feedback:
See section 1.5.2 of the course notes.
--------------------------------------------------------------------------------
13.
Which of the following computations may be performed by exactly one CPU instruction?
a = 5;
a = b + c * 5;
for (i = 0; i < 10; i += a[i++]);
(a) II only
(b) I only
(c) I, II, and III
(d) I and II only
Correct answer is (b)
Your score on this question is: 7.14
Feedback:
See section 1.5.1 of the course notes.
--------------------------------------------------------------------------------
14.
Immediately after the CPU executes an instruction that is neither a branch nor a jump instruction, the program counter
(a) is incremented to point to the following instruction
(b) has a value that cannot be determined without further information
(c) remains unchanged
(d) is incremented by one
Correct answer is (a)
Your score on this question is: 7.14
Feedback:
See section 1.5.2 of the course notes.
--------------------------------------------------------------------------------
Go to top of assessment.
Total score: 71.43
? Copyright 2005 iCarnegie, Inc. All rights reserved.
View Assessment Result: Multiple-Choice Quiz 1
Your performance was as follows:
1.
Integrated programming environments make it difficult to mix and match tools from different sources. This is
(a) good, because tools from different sources cannot be made to interact with each other
(b) bad, because no single vendor is likely to be the source of all the best tools
(c) bad, because all the tools will then have the same user interface
(d) good, because it ensures compilation is not done incrementally by accident
Correct answer is (b)
Your score on this question is: 0.00
Feedback:
See section 1.1.4 of the course notes.
--------------------------------------------------------------------------------
2.
Compared to a sequence of machine code instructions, a fragment of C code
(a) describes the actions of the computer, not just of the CPU
(b) may describe the same algorithm
(c) does not engage any transistors during its execution
(d) is the native way to program most computers
Correct answer is (b)
Your score on this question is: 7.14
Feedback:
See section 1.1.2 of the course notes.
--------------------------------------------------------------------------------
3.
Within Visual C++, which of the following will reveal the value of a variable when the program is stopped at a breakpoint?
Placing the mouse pointer over the variable name in the source file window.
Inserting a printf() in the program.
Typing the variable name on the "Watch" window.
(a) III only
(b) I and III only
(c) I, II, and III
(d) II and III only
Correct answer is (b)
Your score on this question is: 7.14
Feedback:
See section 1.2.3 of the course notes.
--------------------------------------------------------------------------------
4.
In Visual C++, a Win32 Console Application is
(a) the status window of the Visual C++ environment
(b) the simplest type of application Visual C++ can generate
(c) a program that is able to control the operating system of a windows computer
(d) built by using sophisticated "Application Wizards"
Correct answer is (b)
Your score on this question is: 7.14
Feedback:
See section 1.2.1 of the course notes.
--------------------------------------------------------------------------------
5.
What does the following program print?
void callee(int * count) {
count++;
}
int main (int argc, char *argv[]) {
int count = 4;
callee(&count);
printf("%d", count);
return 0;
}
(a) 4
(b) 5
(c) cannot be determined from the information given.
(d) 8
Correct answer is (a)
Your score on this question is: 0.00
Feedback:
See section 1.4.1 of the course notes.
--------------------------------------------------------------------------------
6.
Consider the function factorial() defined as follows.
int factorial(int n) {
if (n == 1) return n;
return n * factorial(n - 1);
}
How many activation records of factorial are allocated by invocation of the expression factorial(4)?
(a) 0
(b) 4
(c) 5
(d) 1
Correct answer is (b)
Your score on this question is: 7.14
Feedback:
See section 1.4.2 of the course notes.
--------------------------------------------------------------------------------
7.
Activation records are organized in stacks because
(a) functions need to access all the variables of the functions that call them.
(b) they are seldom needed during program execution.
(c) stacks allow activation records to be pushed and popped in any order.
(d) stacks are simple enough for the hardware to manage.
Correct answer is (d)
Your score on this question is: 7.14
Feedback:
See section 1.4.2 of the course notes.
--------------------------------------------------------------------------------
8.
Consider the following program.
int i;
int j = 1;
int callee(int number) {
int plusone;
plusone = number + 1;
return plusone;
}
int main (int argc, char *argv[]) {
if (j == 1) return callee(i);
return j;
}
Which of the following are allocated in the activation record immediately after the function callee() is invoked?
(a) plusone and number only.
(b) plusone only.
(c) i, j and number only.
(d) i only.
Correct answer is (a)
Your score on this question is: 7.14
Feedback:
See section 1.4.2 of the course notes.
--------------------------------------------------------------------------------
9.
In a computer in which both addresses and integers are 32 bits wide, how many bytes of memory will the compiler allocate for following code fragment?
int a;
int * b = &a;
(a) 8
(b) 32
(c) 4
(d) 0
Correct answer is (a)
Your score on this question is: 0.00
Feedback:
See section 1.3.2 of the course notes.
--------------------------------------------------------------------------------
10.
The Visual C++ Memory window displays
(a) the names and values of variables in memory, interpreted in one of several ways
(b) the names and values of variables in memory, interpreted as 32-bit integers no matter what the variables' types
(c) the contents of memory, interpreted as 32-bit integers, without the associated variable names
(d) the contents of memory, interpreted in one of several ways, without the associated variable names
Correct answer is (d)
Your score on this question is: 0.00
Feedback:
See section 1.3.3 of the course notes.
--------------------------------------------------------------------------------
11.
Immediately after the CPU executes an instruction that is neither a branch nor a jump instruction, the program counter
(a) remains unchanged
(b) has a value that cannot be determined without further information
(c) is incremented by one
(d) is incremented to point to the following instruction
Correct answer is (d)
Your score on this question is: 7.14
Feedback:
See section 1.5.2 of the course notes.
--------------------------------------------------------------------------------
12.
A CPU register is a word of CPU memory that
(a) is explicitly loaded and unloaded from normal memory by compiler-generated instructions
(b) records the results of periodic CPU diagnostics
(c) houses a critical variable for the duration of the execution of a program
(d) is automatically loaded when a CPU instruction refers to a word of normal memory
Correct answer is (a)
Your score on this question is: 7.14
Feedback:
See section 1.5.3 of the course notes.
--------------------------------------------------------------------------------
13.
Which of the following are true of the effect that optimizations have on the machine code generated by compilers?
The resulting code will be faster and/or smaller.
The resulting code will be clearer.
The resulting code will be harder to debug.
(a) I and II only
(b) I only
(c) I, II, and III
(d) I and III only
Correct answer is (d)
Your score on this question is: 7.14
Feedback:
See section 1.5.3 of the course notes.
--------------------------------------------------------------------------------
14.
Suppose that, using a tool such as the memory window of Visual C++, we found that a certain set of contiguous memory locations contained the integer 0xC605CD623A8365000000. What could these memory locations hold?
the integer 0xC605CD623A8365000000
a string
a CPU instruction
(a) I only
(b) I, II, and III
(c) III only
(d) I and II only
Correct answer is (b)
Your score on this question is: 7.14
Feedback:
See section 1.5.1 of the course notes.
--------------------------------------------------------------------------------
Go to top of assessment.
Total score: 71.43
? Copyright 2005 iCarnegie, Inc. All rights reserved.
1. For an STL iterator it, execution of the statement
++it;
does which of the following?
(a) Advances the iterator to the next item.
(b) Post-increments the item to which the iterator points.
(c) Increase by 1 the size of the container pointed to by it.
(d) Pre-increments the item to which the iterator points.
Correct answer is (a)
Your score on this question is: 10.00
Feedback:
See section 2.1.3 of the course notes.
2.
Which of the following data structures is not a container implemented in the C++ Standard Template Library?
(a) Stack
(b) List
(c) Vector
(d) Hash table
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See section 2.1.1, subsection "STL Overview," in the course notes.
3.
In the STL, common algorithms are instantiated for multiple types of container classes by using _____ to provide a uniform interface between the algorithms and containers.
(a) pointers
(b) virtual functions
(c) arrays
(d) iterators
Correct answer is (d)
Your score on this question is: 10.00
Feedback:
See section 2.1.1, subsection "Iterators," in the course notes.
4.
In the C++ Standard Template Library, vectors and deques differ in their interfaces for handling which of the following operations?
1. Insertion of an element at the front of the container
2. Insertion of an element at the end of the container
3. Removal of an element from the front of the container
(a) III only
(b) I only
(c) I and III only
(d) I and II only
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Section 2.2.3, subsection "Interface," in the course notes.
5.
Consider the following program fragment that calls the method count_if in the C++ Standard Template Library.
deque<int> numbers;
...
count_if(numbers.begin(), numbers.end(), is_odd);
Which of the following declarations for the method is_odd is correct for the call to count_if?
(a) bool is_odd(int begin, int end);
(b) int is_odd(bool i);
(c) bool is_odd(int i);
(d) int is_odd(int begin, int end);
Correct answer is (c)
Your score on this question is: 10.00
Feedback:
See Section 2.2.3, subsection "Interface," in the course notes.
6.
Consider the following program segment.
vector<int> A(10);
A.resize(0);
A.push_back(5000);
At the end of an execution of this fragment, the size of vector A is
(a) 0
(b) 1
(c) 5000
(d) 10
Correct ans
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -