Professional Documents
Culture Documents
De Thi Kiem Giua Hoc Ky
De Thi Kiem Giua Hoc Ky
Mã SV : 21IT447
QN=1 Match each program (numbered 1-5) with its fundamental idea (labeled a-e).
1. Sequential execution
2. Conditional execution
3. Looping
4. Stepwise refinement
5. Calling a function
a. The way we're going to clean the house is to first clean the kitchen, then clean the
bathroom, and then clean each of the three bedrooms one at a time.
b. Look in the phone number and find the number for Rebecca Smith.
c. Stomp your foot five times.
d. Sequential execution
e If it is raining, take an umbrella.
ANSWER: 1-d , 2-e, 3-c, 4-a, 5-b
MARK:
UNIT:
MIX CHOICES:
LO 4
QN=3 Given the initial scene shown below, where Alice is facing the tree, one meter from it.
From Alice's point of view, she can see a penguin to the left side of the tree and a
monkey on the right side of the tree. Each animal is one meter away from the tree. What
is the result of running the following block of code?
a. Alice is near the tree facing the monkey.
b. Alice is near the tree facing the penguin.
c. Alice is near the tree and facing the tree.
d. Alice does not move, instead turning to the right .25 revolutions.
e. Alice is near the penguin and facing the tree.
ANSWER: a.Alice is near the free facing the penguin
MARK:
UNIT:
MIX CHOICES:
LO 4
QN=4 The initial scene below consists of a single penguin. After the following code is
executed, where will the penguin be with respect to its own orientation
a. two meters forward from its starting position
b. one meter forward and one meter to the right of its starting position
c. in the same place
d. one meter forward and one meter to the left of its starting position
ANSWER: c.in the same place
MARK:
UNIT:
MIX CHOICES:
LO 4
QN=5 Our programming coach is in the following scene. After the below code is executed, how
much collective distance will the coach have traveled?
a. 0 meters, coach doesn't move
b. 1 meter
c. 2 meters
d. 3 meters
e.
ANSWER: a.0 meters, coach doesn’t move
MARK:
UNIT:
MIX CHOICES:
LO 3
QN=6 In the following scene, a monkey is standing on a toy ball. The orientation of each object
is unknown. The execution of the below code produces which result?
a. The monkey and ball will move forward towards the camera at the same time.
b. First, the monkey will move forward towards the camera. Then, the ball will move
forward towards the camera.
c. We do not know which direction the ball will move, but the monkey will follow the
direction of the ball, so as to keep standing on it.
d. We do not know which direction the ball will move; the monkey and ball may or may
not move in the same direction as each other.
ANSWER: d. We do not know which direction the ball will move; the monkey and ball may or may
not move in the same direction as each other.
MARK:
UNIT:
MIX CHOICES:
LO 3
QN=11 Which hazard occurs when the pipeline makes the wrong decision on a branch
prediction?
a. Resource hazard
b. Data hazard
c. Control hazard
d. None of the others
ANSWER: c. Control hazard
MARK:
UNIT:
MIX CHOICES:
LO 7
QN=12 Which technique enables parallel execution of instructions in parallel pipelines so long as
hazards are avoided?
a. Pipelining
b. Multithreading
c. Multiprocessing
d. Superscalar
ANSWER: d. Superscalar
MARK:
UNIT:
MIX CHOICES:
LO 7
QN=13 ____ moves data between the computer and its external environment.
a. IO module
b. Peripherals attached to a computer
c. Keyboard and monitor
d. All of the others
ANSWER: a.IO module
MARK:
UNIT:
MIX CHOICES:
LO 4
a. (1)
b. (2)
c. None of the others
d.
ANSWER: a.(1)
MARK:
UNIT:
MIX CHOICES:
LO 3
QN=16 Structure is a concept related to _____(1) The way in which components relate to each
other(2) The operation of individual components as part of the structure
a. (1) only
b. (2) only
c. Both (1) and (2)
d. None of the others
ANSWER: a.(1)only
MARK:
UNIT:
MIX CHOICES:
LO 3
QN=24 For the following C program, what is the result on the screen when executing the
program?
#include "stdio.h"
#include "conio.h"
#include "iostream"
int main()
{
unsigned char n,i,a;
n=10;
a=1;
for (i=1;i<=n;i+=2) a=a*i;
printf("%d",a);
getch();
}
a. 217
b. 177
c. 945
d. 257
ANSWER: b.177
MARK:
UNIT:
MIX CHOICES:
LO 8
QN=25 For the following C program, what is the result on the screen when executing the
program?
#include "stdio.h"
#include "conio.h"
#include "iostream"
int main()
{
char n,i,a;
n=10;
a=1;
for (i=1;i<=n;i+=2) a=a*i;
printf("%d",a);
getch();
}
a. -79
b. 177
c. 945
d. 217
ANSWER: a.-79
MARK:
UNIT:
MIX CHOICES:
LO 8
QN=26 __________ converts the programs written in assembly language into machine
instructions.
a. Machine compiler
b. Interpreter
c. Assembler
d. Converter
ANSWER: c. Assembler
MARK:
UNIT:
MIX CHOICES:
LO 5
QN=27 __________ converts the programs written in assembly language into machine
instructions.
a. Machine compiler
b. Interpreter
c. Assembler
d. Converter
ANSWER: c.Assembler
MARK:
UNIT:
MIX CHOICES:
LO 5