Vous êtes sur la page 1sur 12

Note! Answer sheet!

Computers and Software Engineering A, 15 credits, DV006A


Example of Final examination
Time: Wenesday, 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!

Chapters 1 - 5

1.1 What is the result of the binary operation 11110000 XOR 00000000 ?

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

ANSWER: A

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

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

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

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


ANSWER: A

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. An interrupt B. A semaphore C. A login

ANSWER: A

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 Which of the following is a mechanism that limits the number of times that a packet is
forwarded as it is routed through the Internet?

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

ANSWER: D

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

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: B
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. Oliver

ANSWER: C

Chapter Six (Programming Languages)

1.11 What is the final activity in the translation process?

A . source program B. lexical analyzer C. code generator D. object program

ANSWER: C

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.13Which one of the following was developed by the U.S. Navy for business applications?

A. COBOL B. FORTRAN C. ADDI D. HLT

ANSWER: A

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

A. constructor B. inheritance C. extension D. compilation

ANSWER: A

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


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 B: modular C: validation D: incremental

ANSWER: D

1.18Which
one of the following refers to testing that does not rely on knowledge of the interior
composition of the software?

A:basis path testing B:glass-box testing


C:black-box testing D:beta testing

ANSWER: C

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 .class diagram C. entity-relationship diagram

ANSWER: C

Chapter Eight (Data Abstraction)

1.21What do we use to mark the end of a linked list?

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

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*(i-1))+(j-1)
B. x+(c-1)+(j*(i-1))
C. x+(c*j+1)+(i+1)
D. x+(i*(c-j)+1)

ANSWER: A
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.24Removing an entry from the top of a stack is called?

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

ANSWER: B

1.25The process of reclaiming unused storage space for the future use is known as _____.

A: Binary search B: Direct memory access C: Garbage collection

Answer: C
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 4 Kilobytes of main memory?

ANSWER: 8 X 4 X (1024) = 32,768 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 What are two basic differences between the transport level protocols named UDP and
TCP?

ANSWER: 1. TCP establishes a logical connection between initiating computer and


responding computer while UDP just sends a message with no initial contact. 2. The origin and
destination computers use acknowledgements and retransmissions to insure that all sent
segments are received in full. UDP does no such checking.
2.8 What is the main purpose of a DNS name server?

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 < 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: 7, 7, 5, 3

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.
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.16What is the purpose of technical documentation?

Answer: the purpose of technical documentation is to describe how a software system should
be installed and serviced.

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 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
/\
E I
/\ /\
C F H J
/\
B D

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 contiguous list.

ANSWER: The advantage is that it is a convenient storage structure for implementing static
lists. The disadvantage is when entries are added to and deleted from the list (so-called
"dynamic list") since holes will appear in the list that cannot be re-used.
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 AND, OR, XOR, NOT.


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 be used to execute a program that is too large to fit into main memory.

A. bit B. buffer C. virtual memory


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

ANSWER: 3.1: D, 3.2: M, 3.3: H, 3.4: P, 3.5: C

Chapters 4 - 5

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


3.7A means of connecting networks to form an internet.
3.8Identifies a machine on the Internet.
3.9An informal notation for representing algorithms.
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: M, 3.9: J, 3.10: B

Chapter Six (Programming Languages)

3.11What is the name for the simultaneous execution of multiple activations?


3.12 This is oneof the three activities involved in translating a program from one language to
another.
3.13What is the name in the object-oriented paradigm for a template used to create identical
objects?
3.14 This can be interpreted by a virtual machine that has been installed in a web browser.
3.15The programming paradigm called imperative is also referred to as the ______ paradigm.

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: N, 3.12: B, 3.13: L, 3.14: M, 3.15: R

Chapter Seven (Software Engineering)

3.16This is a tool that is useful during both analysis and design and expresses relationships as
one-to-one, one-to-many or mant-to-many.
3.17 A powerful tool for software engineers is the ______ which is a predeveloped method of
solving a recurring problem in software design.
3.18 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.19 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.
3.20 One distinction between software engineering and other engineering disciplines is the lack
of qualitative techniques, called _______ , for measuring the properties of software..

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: C, 3.18: G, 3.19: E, 3.20: L


Chapter Eight (Data Abstraction)

3.21In the object-oriented programming paradigm, an object is described by a template known


as a ________.
3.22 A stack is also known as a _______ data structure.
3.23 A dynamic list must be stored in computer memory using a ______ data structure.
3.24 Which pointer provides initial access to a tree data structure?
3.25 Each entry in a linked list consists of two pieces: a name and a to the next entry.

A. contiguous list B. circular queue C. function


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

ANSWER: 3.21: K, 3.22: N, 3.23: F, 3.24: M, 3.25: L

Vous aimerez peut-être aussi