Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

Note! Answer sheet!

Computers and Software Engineering A, 15 credits, DV006A


Final examination
Time: Wednesday, March 26, 2008
Place: 96:243
Duration: 3 hours

Exam aids: This is a closed-book exam. The only student materials allowed are pencils,
erasers and an approved paper (not electronic) 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!

Section 1. Questions with Multiple Choice Answers (There are 25 questions


in this section each worth 1 point apiece.)
Answer these questions with only one letter!
ANSWERS TO ALL QUESTIONS IN SECTION 1:

1.1 D 1.6 B 1.11 B 1.16 B 1.21 C


1.2 A 1.7 A 1.12 B 1.17 B 1.22 C
1.3 B 1.8 C 1.13 B 1.18 A 1.23 A
1.4 D 1.9 C 1.14 D 1.19 A 1.24 A
1.5 C 1.10 A 1.15 C 1.20 B 1.25 A

Chapters 1 - 5

1
1.1 What is the result of the binary operation 11110000 OR 00001111 ?

A. 11110000 B. 10100101 C. 00000000 D. 11111111

ANSWER: D

1.2 What is the base ten value of the binary fraction 101.100 ?

A. 5.5 B. 5.625 C. 5.75 D. 45

ANSWER: A
1.3 Which of the following instructions falls into the category of data transfer instructions?

A. JUMP B. LOAD C. ROTATE D. AND


ANSWER: B

1.4 When a STORE operation is performed, what information besides the data to be stored
must be sent over the bus to main memory by the CPU?

A. the program counter contents B. the instruction register contents


C. the contents of register 0 D. an address

ANSWER: D

1.5 The end of a time slice is indicted by the occurrence of a signal called

A.a bootstrap B. a semaphore C. an interrupt

ANSWER: C

1.6 Which of the following items of information would not be contained in an operating
system’s process table?

A. The location of the memory area assigned to the process


B. The machine language instructions being executed by the process
C. The priority of each process
D. Whether the process is ready or waiting

ANSWER: B

1.7 What is the name of the rules that are used to conduct computer network activities?

A. Protocol B. Port number C. Domain D. Hop count

ANSWER: A

1.8 Which layer of the TCP/IP hierarchy directs message segments through the Internet so that
they get closer and closer to their destination?

A. Application B. Transport C. Network D. Link

2
ANSWER: C

1.9 Which of the following set of instructions defines an algorithm in the formal, strict sense?

A. X ← 3; B. X ← 3; C. X ← 3;
while (X < 5)do while (X < 5) do while (X < 5) do
(X ← X) (X ← X - 1) (X ← X + 1)
ANSWER: C

1.10When searching within the list

Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger

which of the following entries will take the least time to find using the binary search algorithm?

A. Maurice B. Nathan C. Roger

ANSWER: A

Chapter Six (Programming Languages)

1.11 What is the first activity in the translation process?

A . source program B. lexical analysis C. code generation D. object program

ANSWER: B

1.12What is a set of instructions for performing a task that can be used as an abstract tool by
other program units?

A. Program B. Procedure C. Process.

ANSWER: B.

1.13What is the name for the simultaneous execution of multiple activities?

A.verticle processing B.parallel processing


C.simultaneous processing D.procedure

ANSWER: B

1.14Which technique is used to set the initial data in object-oriented programming?

A. compilationB. inheritance C. extension D. constructor

ANSWER: D

1.15What is the conceptual shape or arrangement of data in a program to which variables are
often associated (in addition to data type)?

A. homogeneous arrays B. primitive data types C. data structure

3
D. heterogeneous arrays

ANSWER: C

Chapter Seven (Software Engineering)

1.16Which of the following is a tool, used for years by software engineers, that is a central
repository of information about the data items appearing throughout a software system?

A: entity relationship B: data dictionary C: data flow diagram

ANSWER: B

1.17What is the name of the software development model used to develop prototypes that has
recently become popular with software engineers and challenges the waterfall model?

A: open-source modelB: incremental model


C: validation model D: modular model

ANSWER: B

1.18Whichone of the following refers to testing that insures that each instruction in the
software is executed at least once?

A:basis path testing B:glass-box testing


C:black-box testing D:beta testing

ANSWER: A

1.19What is the name of the software development model where a team of less than a dozen
programmers work closely together and freely share ideas and assist each other during the
development process?

A: extreme programming B: rapid prototyping C: waterfall D: incremental¨

ANSWER: A

1.20Which of the following items is not included in Unified modeling Language (UML)?

A. use case diagram B . entity-relationship diagram C. class diagram

ANSWER: B

Chapter Eight (Data Abstraction)

1.21What kinds of pointers are used to characterize a terminal node in a binary tree?

A. Head pointer B. New pointer C. NIL pointer D. New pointer

4
ANSWER: C

1.22Let X be the address of the memory cell containing the entry in the first row and first
column of a static array stored using row major order. If we let C represent the number of
columns in the array (which is the number of entries in each row), the address of the entry
in the i th row and j th column will be?

A. x+(c*j+1)+(i+1)
B. x+(c-1)+(j*(i-1))
C. x+(c*(i-1))+(j-1)
D. x+(i*(c-j)+1)

ANSWER: C

1.23If thenodes of a binary tree are stored in a single contiguous block of memory cells, which
number should be used to divide the node's position in the block if we want to find the
location of a node's parent?

A: 2 B: 3 C: 4 D: 5

ANSWER.(A)

1.24What is the name of the action of adding an element to the top of a stack?

A. Pushing an entry
B. Popping an entry
C. Removing an entry

ANSWER: A

1.25What is the term used to describe the phenomenon in which memory space slowly
disappears when garbage collection fails to reclaim storage space?

A: memory leak B: direct memory access C: indirect addressing

Answer: A

5
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.
Chapters 1 - 5

2.1 How many bits would be in the memory of a computer with 1 Kilobyte of main memory?

ANSWER: 8 X (1024) = 8192 bits.

2.2 What is the largest numeric value that could be represented with three bytes if each digit
were encoded using one ASCII pattern per byte? What if binary notation were used? (Just
give an expression for the numeric value; you do not need to calculate the actual value.)

ANSWER: With ASCII, the largest numeric value is 999. With binary notation, the largest
value is 2**24 = 16,777,215.

2.3 Can AND-operations be performed directly on memory cells? Explain your answer!

ANSWER: No. The only operations that can be performed on memory cells are LOAD (from
memory cell to register) and STORE (from register to memory cell). Data must reside in a
register before it can be manipulated by a binary operation such as AND.

2.4 What are the three operations performed during each machine cycle?

ANSWER: Fetch, decode, execute


2.5 Suppose an operating system allocates time slices in 5 millisecond units and the time
required for a context switch is negligible.

A. How many processes can obtain a time slice in one second?

B. How many processes can obtain a time slice in one second if they all use only half
of their slice?

ANSWER: A. 200 B. 400

2.6 What is the difference between time-sharing and multitasking?

ANSWER: Multitasking means that a number of tasks are run at the same time. Time-sharing
allows tasks to share a single CPU by giving each task a time-slice.

2.7 Describe the protocol named IP?

ANSWER: The Internet Protocol is the only network layer protocol in the TCP/IP protocol
suite. An IP packet contains an IP-header plus a payload which may, for example, be a TCP
segment. The current version is 4 but IPv6 is available and waiting for the day when all the
IPv4 addresses are in use. The IP-header contains the source and destination addresses of the
packet as well as a time-to-live value.

2.8 What is the main purpose of a DNS name server?

6
ANSWER: The main purpose of a name server is to translate a domain name into an
IP-address.

2.9 What sequence of values will be printed when the following instructions are executed?

X ← 7;
while (X < 8) 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: 7, 8, 8, 6, 4

2.10Do the following instructions define an algorithm? Explain your answer!

Write down one hundred positive odd integers.


Select the last integer in the list.
Print the even integer that is one less than the selected odd integer.

ANSWER: Yes, the instructions are unambiguous and executable.

Chapter Six (Programming Languages)

2.11 What is the most obvious advantage of a software development system?

ANSWER: A programmer can move back and forth between the editor and debugging tools
with ease, as changes to the program are made and tested.

2.12What is the difference between a procedure and a function?

ANSWER: A function is a procedure that returns a value associated with the function
name.

2.13Why is a program written in assembly language not easy to transport to a computer


of a different design?

ANSWER: Because the program must be rewritten to conform to the new computer’s
register configuration and instruction set.

2.14Explain the use of inheritance in object-oriented programming.

ANSWER: One class can inherit the properties of another class by using inheritance. This
means that all of the data and methods from the parent class are inherited by the child class.

7
The child class usually adds some of it's own data and methods, making it different from the
parent class.

2.15What is the goal of structured programming?

ANSWER: The idea is to produce a program that can be easily understood by a programmer
and can be shown to meet its specifications.

Chapter Seven (Software Engineering)

2.16Describe the software development tool called a Design Pattern.

ANSWER: A Design pattern is a predeveloped method of solving a recurring problem in


software design.

2.17What is the difference between the traditional waterfall model of software development and
the newer prototyping paradigm?

ANSWER: The traditional waterfall approach dictates that the analysis,design,implementation


and testing phases be performed in a linear manner.The prototyping model allows for a more
releaxed trial-and-error approach.

2.18What are the four major stages within the development phase of the software life cycle?

ANSWER: Analysis, Design, Implementation, Testing (ADIT)

2.19Draw a diagram that describes the software life cycle.

ANSWER: Development ----- > Use --------- >


^ |
| v
- - Modification- -

2.20What is the theory behind a dataflow diagram?

ANSWER: If a software designer studies the movement of data through a system, the points at
which data formats are altered or where data paths merge and split can be identified. These are
the points at which processing occurs and where procedures must be defined.

Chapter Eight (Data Abstraction)

2.21Draw a diagram of a binary tree that stores the ordered list B, C, D, E, F, G, H, I, J, K so


that it can be used later on for effective searching.

ANSWER: G
/\

8
E I
/\ /\
C F H J
/\ \
B D K

2.22Explain why a modern programming language such as Java does not include pointers as a
printive data type.

ANSWER: Pointers are easily misused by programmers and can cause problems when
debugging and testing programs.

2.23Name the pointers used to manage a stack stored as a contiguous block of memory cells
and then explain how these pointers are used when a new entry is pushed onto the stack.

ANSWER: There are two pointers used, one that contains the memory address of the base (or
bottom) of the stack and another that has the address of the top (usually called the stack
pointer). To push an entry, we adjust the stack pointer to the vacancy just beyond the top of
the stack.Then place the new entry at this location.

2.24What is the difference between a list, a stack and a queue?

ANSWER:
A list is a collection of entries that are arranged sequentially. Beginning of list is called the head
and end of the list is called the tail.
A stack is a list in which entries are removed and inserted only at the head.
A queue is a list in which entries are removed only at the head and new entries are inserted
only at the tail.

2.25Describe the advantages and disadvantages of a linked list.

ANSWER: The advantage is that it has the ability to expand while effectively using available
memory space which is essential when creating dynamic lists. The disadvantage is that each
stored element requires room for the element value and a pointer (or address).

9
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.
Chapters 1 - 3

3.1 193.10.1.1
3.2 A segment of a track in a mass storage system.
3.3 The part of a machine instruction that is not the op-code.
3.4 An apparatus (usually on a printed circuit board) that handles communication between a
computer and other devices.
3.5 Can store the value of a single bit.

A. bit B. buffer C. virtual memory


D. boolean operations E. ISO F. formating
G. IP address H. operand I. JPEG
J. hexadecimal notation K. port L. handshaking
M. sector N. flip-flop O. kernel
P. controller

ANSWER: 3.1: G, 3.2: M, 3.3: H, 3.4: P, 3.5: N

Chapters 4 - 5

3.6 A container for information that is routed through the Internet.


3.7 A means of connecting networks to form an internet.
3.8 The act of a procedure calling itself.
3.9 A popular technology for building a LAN.
3.10A basic building block.

A. internet B. primitive C. ISP


D. domain E. URL F. firewall
G. protocol H. search engine I. packet
J. pseudocode K. Ethernet L. XML
M. IP address N. loop invariant O. FTP
P. recursion Q. IP R. router

ANSWER: 3.6: I, 3.7: R, 3.8: P, 3.9: K, 3.10: B

Chapter Six (Programming Languages)

10
3.11To simplify the description of objects with similar yet different characteristics, object-
oriented languages allow one class to encompass the properties of another through a
technique known as _______ .
3.12The programming paradigm called imperative is also referred to as the ______ paradigm.
3.13 This is one of the three activities involved in translating a program from one language to
another.
3.14What is the name in the object-oriented paradigm for a template used to create identical
objects?
3.15 This can be interpreted by a virtual machine that has been installed in a web browser.

A. inheritance B. parsing C. functional


D. verticle E. declarative F. logical
processing
G. object H. programming I. statement
J. instance K. object-oriented L. class
M. byte code N. parallel O. grammar
processing
P. translation Q. java R. procedural
ANSWER: 3.11: A, 3.12: R, 3.13: B, 3.14: L, 3.15: M

Chapter Seven (Software Engineering)


3.16 This is a tool that is useful during both analysis and design and expresses relationships as
one-to-one, one-to-many or many-to-many.
3.17______ testing involves confirming that the software system as implemented conforms to
the requirements and specifications identified during the original analysis.
3.18One distinction between software engineering and other engineering disciplines is the lack
of qualitative techniques, called _______ , for measuring the properties of software.
3.19 The application of computer technology to the software development process has resulted
in a variety of ________ tools which continue to streamline and otherwise simplify the
software development process.
3.20 In early approaches to software engineering, engineers insisted that the entire analysis of
the system be completed first and this came to be known as the ______ model since the
development process was allowed to flow in only one direction.

A. XP B. specifications C. design
pattern
D. dataflow E. waterfall F. CRC
diagram
G. CASE H. entity- I. fountain
relationship
diagram
J. use case K. data dictionary L. metrics
diagram
M. class diagram N. parameters O. indicators
P. module Q. validation R. UML
ANSWER: 3.16: H, 3.17: Q, 3.18: L, 3.19: G, 3.20: E

Chapter Eight (Data Abstraction)

3.21If we select any node in a tree, we find that the node together with the nodes below it
form a ______ .
3.22 A queue is also known as a _______ data structure.

11
3.23 A ______ is the most appropriate way to store and maintain a dynamic data structure.
3.24 A pointer that provides initial access to a tree data structure.
3.25 A is a convenient storage structure for implementing a static list.

A. contiguous list B. circular queue C. function


D. subtree E. project F. linked list
G. program H. head pointer I. right child
pointer
J. left child K. tree L. pointer
pointer
M. root pointer N. LIFO O. procedure
P. FIFO Q. nil pointer R. instance

ANSWER: 3.21: D, 3.22: P, 3.23: F, 3.24: M, 3.25: A

12

You might also like