CSE Midterm Exam Example HT2007 Answers
CSE Midterm Exam Example HT2007 Answers
Exam aids: This is a closed-book exam. The only student materials allowed are pencils,
erasers and an English-Chinese dictionary.
General Instructions: Write your answers on separate sheets of paper and do not write your
answers on the pages of the exam. Start each section of the exam on a new sheet of paper.
Write on only one side of each answer sheet and put your name at the top of each answer
sheet. If the question is unclear to you, explain the ambiguity and your interpretation of the
question in your answer. Try to answer all of the exam questions and use illustrations in order
to get partial credit for the question. However, if the question asks for exactly two responses,
do not answer with three or more alternative answers.
Note that some of the questions related to Chapter 2 (Data Manipulation) refer to
Appendix 1: language description table on the last page of this exam.
Scoring: There are a total of 75 questions and a maximum of 100 points in this exam. At least
50% of the maximum number of points must be scored in order to get a passing grade. The
ECTS scale will be used on all passing grades (i.e., grades of A, B, C, D and E will be given).
The questions are not listed in order of difficulty.
GOOD LUCK!
1.1 Which of the following Boolean operations produces the output 1 for the fewest number of
input patterns?
A. AND B. OR C. XOR
ANSWER: A
1.2 What is the result of the binary operation 11110000 XOR 01010101?
ANSWER: B
1.3 Which of the following bit patterns represents the decimal integer value 22?
A. 00011010 B. 00010111 C. 00010110 D. 00010010
ANSWER: C
1.4 Assuming that each of the following bit patterns originally had even parity, which one
contains an error?
ANSWER: D
A. 8 B. 12 C. 16 D. 24
ANSWER: C
ANSWER: D
1.7 Which of the following instructions (as described in the Appendix 1: language description
table) changes the contents of a memory cell?
ANSWER: C
1.8 Which of the following instructions (as described in the Appendix 1: language description
table) places 00000000 in register A?
ANSWER: B
1.9 Which of the following instructions (as described in the Appendix 1: language description
table) changes the contents of register 7?
ANSWER: C
1.10In which of the following locations is information most readily available for manipulation
by the CPU?
ANSWER: A
Chapter Three (Operating Systems)
ANSWER: B
1.12Which of the following components of an operating system handles the details associated
with particular peripheral equipment?
ANSWER: A
ANSWER: C
ANSWER: A
ANSWER: A
1.16Which of the following is not a protocol used in the basic TCP/IP software hierarchy?
ANSWER: A
1.17Which layer of the TCP/IP hierarchy reassembles messages as their pieces arrive at the
destination?
ANSWER: B
1.18Which layer of the TCP/IP hierarchy directs message segments through the Internet so that
they get closer and closer to their destination?
ANSWER: C
1.19Which layer of the TCP/IP hierarchy is responsible for obtaining the correct URL
(Uniform Resource Locator) for a message’s destination?
ANSWER: A
1.20Which of the following identifies the application to which a message arriving from the
Internet should be given?
ANSWER: B
ANSWER: C
ANSWER: B
1.23Which of the following Java statements is guaranteed to loop at least one time?
ANSWER: C
which of the following entries will be found most quickly using the sequential search
algorithm?
ANSWER: A
1.25When searching within the list
which of the following entries will be found most quickly using the binary search algorithm?
ANSWER: B
Section 2. Fill-in-the-blank/Short-answer Questions (There are 25 questions
in this section each worth 2 points apiece.)
Answer these questions with words, numbers and/or sentences.
Chapter One (Data Representation)
ANSWER: B49F
2.3 How many different bit patterns can be formed if each must consist of exactly 6 bits?
ANSWER: 64
2.4 Describe how a computer can produce an incorrect answer when performing numerical
computations even though it has not malfunctioned.
ANSWER: Most students will probably refer to overflow and truncation errors.
2.5 If a term paper consisted 40 pages, each containing 40 lines of 100 symbols each (counting
each space as a symbol), was to be encoded using Unicode, how many bytes of storage
space would be required?
2.6 If register 0 contains the pattern 01101001 before executing the instruction A003 (see the
language description table), what bit pattern will be in register 0 after the instruction is
executed?
ANSWER: 00101101
2.8 Encode each of the following commands in terms of the machine language described in
Appendix 1: language description table.
B. LOAD register 7 with the contents of the memory cell at address A5.
C. ADD the contents of registers 5 and 6 as thought they were values in two’s
complement notation and leave the result in register 4.
2.9 What is the difference between a conditional jump instruction and an unconditional jump
instruction?
ANSWER: A conditional jump instruction will result in a “jump” to another location only
under certain conditions whereas an unconditional jump instruction will result in a “jump” to
another location under all conditions.
2.10Using the machine language described in the language description table, write a sequence
of instructions that will place the pattern FF in the memory cell at address A0.
ANSWER: 2XFF, 3XA0 (where X can be any register but must be the same in both
instructions)
ANSWER: Possible answers include: UNIX, LINX, and Microsoft’s Windows series
ANSWER: Possible answers include: Memory space, mass storage space, printers, space in
process table, CPU time, and many more
2.14What is the difference between a process that is waiting as opposed to a process that is
ready?
ANSWER: A process that is waiting would not be able to advance if given a time slice
(perhaps because it is waiting for a peripheral device to complete a task) whereas a process
that is ready would be able to continue execution if given a time slice.
ANSWER: System software provides the infrastructure required by the application software. It
includes the operating system and utilities. Application software provides the unique
functionality required to perform the particular tasks for with the computer is used. Examples
include word processors, spreadsheet systems, database systems, and image processing
systems.
2.17What are two protocols for implementing the transport level in the “TCP/IP hierarchy”?
2.18Rewrite the URL below in your answer sheet and underline the portion that identifies the
classification of the registered top-level domain in which the pertinent Web server resides.
Draw a rectangle around the portion that indicates the directory path the server should
follow to find the designated document.
http://batcave.metropolis.com/heroes/superheroes/batpage.html
2.19Many people use the terms Internet and world-wide web interchangeably. What is the
difference between the Internet and the world-wide web?
ANSWER: The Internet is the infrastructure used by the world-wide web. That is, the world-
wide web is only one application of the Internet. Other applications include email, ftp, and
telnet.
2.20Draw a sketch showing how the following HTML document would appear on the
computer screen when displayed by a browser.
<html>
<head>
<title>This is the title</title>
</head>
<body>
<h1>Mud Art</h1>
</body>
</html>
ANSWER: The displayed page contains only the words “Mud Art” displayed as a major
heading. The words “This is the title” are NOT part of the displayed page.
Chapter Five (Algorithms)
2.21What sequence of values will be printed when the following instructions are executed?
X ← 5;
while (X < 7) do
(print the value of X;
X ← X + 1)
print the value of X;
while (X > 2) do
(print the value of X;
X ← X - 2)
ANSWER: 5, 6, 7, 7, 5, 3
2.22Suppose the binary search algorithm was being used to search for the entry Tom in the list
What would be the first entry in the list to be considered? What would be the second entry in
the list to be considered?
X ← 3;
print the value of X;
Y ← 5;
if (X < Y) then (print the value 6)
else (print the value 7)
ANSWER: 3, 6
X ← 3
while (X ≠ 8) do
(X ← X + 2)
ANSWER: The termination condition will never be reached because X will always be odd.
Section 3. Vocabulary (Matching) Questions (There are 25 questions in this
section each worth 1 point apiece.)
Answer these questions with the one letter of the word in the list that best
matches the description.
Chapter One (Data Representation)
3.6 The part of a machine instruction that identifies the basic operation to be performed.
3.7 The process of fetching and executing instructions that is repeated over and over by the
CPU.
3.8 A location within a CPU for temporary data storage.
3.9 Used by the CPU to keep its place in the program being executed.
3.10 Used to synchronize the operations within a computer.
3.11 The act of performing more than one activity at the same time.
3.12 A means of communicating with a computer user by means of images rather than words.
3.13 The program first executed when a computer is turned on.
3.14 The heart of an operating system.
3.15 A signal that suspends the CPU’s current activities.
3.16 A notational system for indicating how a Web document is to be displayed by a browser.
3.17 A means of blocking undesired messages.
3.18 A means of connecting networks to form an internet.
3.19 A means of finding relevant information on the Web.
3.20 A means of implementing a network with the bus topology.