CH 08
CH 08
CH 08
FACULTY OF SCIENCE
Full Name :
Grade Obtained :
Important Note
• Answer neatly to all the questions on the space provided on the question paper
• Write short, and grammatically and logically correct sentences
Page - 1-
Part I: Computer organization and assembly (11
(11 pts total)
1. Base your answer to the questions below on the following fragment of code t hat sorts a list of numbers in
ascending order using the bubble sort algorithm. Assume that the list is already stored in the memory.
mov cx, p
dec cx
lp1: mov di, cx
mov bx, 0
lp2: mov ax, a[bx]
cmp ax, a[bx+2]
jle continue
xchg ax, a[bx+2]
mov a[bx], ax
continue: add bx, 2
loop lp2
mov cx, di
loop lp1
1.2. (1 pt) Which variable contains the size (ie. Number of elements) of the list?
1.4. (1 pt) What size (or type) are the variables a and p?
1.5. (3 pts) List the different addressing modes used in the code.
Page - 2-
Part I: Computer organization and assembly (11
(11 pts total)
1. Base your answer to the questions below on the following fragment of code t hat sorts a list of numbers in
ascending order using the bubble sort algorithm. Assume that the list is already stored in the memory.
mov cx, p
dec cx
lp1: mov di, cx
mov bx, 0
lp2: mov ax, a[bx]
cmp ax, a[bx+2]
jle continue
xchg ax, a[bx+2]
mov a[bx], ax
continue: add bx, 2
loop lp2
mov cx, di
loop lp1
1.2. (1 pt) Which variable contains the size (ie. Number of elements) of the list?
1.4. (1 pt) What size (or type) are the variables a and p?
1.5. (3 pts) List the different addressing modes used in the code.
Page - 2-
1.6. (4 pts) Modify the code as little as possible so that it sorts in descending order.
Page - 3-
Part II: Programming (16 pts total)
1.
a. (2 pts) Give an abstract definition of a linked list
b. (6 pts) Write the algorithm of a function that inserts an element in a linked list of integers using
FIFO.
Page - 4-
2. (8 pts) Design a detailed algorithm to sort a given data of integers into ascending order using a bubble
sort algorithm. Write a function that implements this algorithm in a programming language of your
choice.
Page - 5-
Part III: Software Engineering (14 pts total)
1. (3 pts) Compare and contrast procedural and object-oriented programming languages.
2. (3 pts) What is the relationship between abstract data types and classes?
3. (4 pts) Give three phases of your choice among the phases of the software development life cycle and
give, for each phase, its role in the software development process. A maximum of one sentence is
accepted for each phase.
Page - 6-
4. (4 pts) Choose one of the following topic (a, b or c) and explain very briefly.
a. Waterfall, Spiral, and Prototyping models. For what type of development projects are each of
these software development models used?
b. Software metrics. Discuss size, complexity, and quality metrics.
c. Structural and functional software testing methods. Discuss the various structural and functional
testing techniques, which are commonly used in software development projects.
Page - 7-
Part 4: Database Systems (15 pts total)
1. FIFA would like to keep track of information about events of the World cup 2002 in Korea/Japan. The
following are definitions of some of the tables identified to organize the database for FIFA. Use this
information to answer subsequent questions.
Table Definitions
Player (Id, Name, Specialization, Country)
Foreign key – Country references History
Played (Id, Match, Goals, Cards, Fouls, Offsites)
Foreign key – Id references Player, Match references Games
Games (Match, Stadium, Date)
Foreign key – Stadium references Places
Places (Stadium, Host)
History (Country, Population, Worldcup, Won)
Page - 8-
Using the above information, write an SQL statement that performs the following:
1.1 (2 pts) Create a table with name Dangerous-Players and store Id, Name, Country, Match and Fouls for
players who committed more than 3 fouls in a single game.
1.2 (3 pts) Display Match, Stadium, Date and Host for matches in which more than four goals are scored.
1.3 (3 pts) Display Name, Id and Country of a player who came from a country with good world cup
history (won world cup at least ones) and who has never played in any game in this world cup (stayed
on a reserve bench).
Page - 9-
2. (4 pts) Normalization is one of the important aspects of relational database design. Discuss the first two
normal forms (1NF, 2NF). Elaborate your answer using Examples.
3. (3 pts) Concurrency is one of the major problem areas that the database designer has to deal with in the
shared database environments. Describe very briefly any two of such concurrency problems and discuss
methods used to overcome the problems.
Page - 10-
Part 5: Operating system (14 pts total)
2) (3 pts) Describe the three process states and the functions involved in the transition of processes from
one state to another. Use a diagram to demonstrate your answer.
3) (3 pts) Selection of the value of the quantum time in CPU scheduling is one important aspect of the
algorithms. Discuss the problems associated with the selection of a very small quantum value and a very
large one?
Page - 11-
4) (6 pts) Write a program that runs on UNIX (i.e. that uses UNIX system calls) and creates two processes.
The first process should write PING, then the second should write PONG, then the first should write
PING, then the second should write PONG, etc. indefinitely. You can use any communication and
synchronization method available on UNIX and any programming language.
Page - 12-
Part 6: Networking (15 pts total)
1) (3 pts) Choose two layers out of the seven layers of the ISO/OSI Networking model. Describe i n a few
words the main role (function) of each of the two layers that you have chosen (1 small sentence for each
layer)
2) (2 pts) Give at least two popular physical media used for computer networking. Compare briefly their
characteristics for communication.
3) (2.5 pts) Explain briefly what Carrier Sense Multiple A ccess/ Collision Detection (CSMA/CD) is,
where it is used and what are its two main concepts.
Page - 13-
4) (2.5 pts) Given a base IP address 195.201.121.0 and using the first three bits of the host address part of
the IP address as a sub network prefix:
a. What is the standard class of this IP address?
_________________________________________________________________
b. What will be the subnet mask?
_________________________________________________________________
c. What will be the number of usable subnets?
_________________________________________________________________
d. What will be the number of unique host addresses supported in each subnet?
_________________________________________________________________
e. What will be the first available IP address that can be assigned to a PC connected in the third
usable subnet?
_________________________________________________________________
5) (5 pts) Write the letter of the descriptions under column B that best matches phrases under column A in
the space provided.
Answer Column A Column B
A. Ensures that external communications confirm to the
1. Circuit Switching
local network security policy.
B. Responsible for assigning Internet addresses to
2. DNS
users.
3. Gateway C. Physical layer protocol of X.25.
D. One of the ISDN channel services provided at a
4. Routers
single interface.
E. Packet switching technology that involves fixed
5. Fire Wall
length data unit.
F. Converts numerical IP address in to readable text
6. FDM or TDM
form.
G. Allows several transmission sources to share a larger
7. RS-232
transmission capacity.
H. Lines are dedicated for the duration of the
8. Cell Relay
connection.
I. Make use of RIP to transfer data packets across
9. 23B+D
multiple networks.
J. Performs translation between two dissimilar
10. ISP
networks.
Page - 14-
General questions on ICT in Ethiopia and abroad (15 pts total)
Instruction: Attemptany two of the following five questions. If you attempt more than two none will be
accepted.
Each question is given 7.5 points as long as you follow the above instructions.
1. IBM mainframe computers used to be called a closed/proprietary system: What does it mean?
2. Do you see advantages/drawbacks in liberalizing the telecom sector in the Ethiopian context? Justify
your answer.
Page - 15-
3. List three major obstacles against the development of ICT in Ethiopia. Argument your answer.
4. It is nowadays very commonly said that there is convergence of information technologies and
communication technologies. What does this statement mean? Give examples to j ustify your answers.
5. State and explain two ethical rules an IT professional must follow in Ethiopia.
Page - 16-
ADDIS ABABA UNIVERSITY
FACULTY OF INFORMATICS
Full Name :
Grade Obtained :
Important Note
• Write your name only on this page. Writing your name on the other
pages will automatically disqualify you from this exam.
• Answer neatly to all the questions on the space provided on the question paper
• Write short, and grammatically and logically correct sentences
Page 1 of 14
Part I: Computer organization and assembly (15 points total)
1. (4 points) Give two applications where writing the code in assembly language rather than in high-
level language is compulsory or highly beneficial. Explain very succinctly why it is compulsory or
highly beneficial.
# Application Reason
1
2. (2 points) Give two major concepts that make the difference between RISC and CISC
technologies and how these concepts contribute in improving the performance of the processor.
3. (1 point) Give the name of an existing processor that is built based on RISC technology.
# Application
1
Page 2 of 14
5. (2 Points) Give the name of the character encoding system that is most widely used for encoding
of texts in most alphabets and scripts of the World. What are the differences between this system
and the Latin character encoding system almost exclusively used, until recently, to encode texts in
Latin characters? What are its advantages and its drawbacks ? Answer very succinctly in the table.
Name of the
character
encoding
system
Differences
Advantages of
the character
encoding
system
Drawbacks of
the character
encoding
system
6. (4 points) We would like to write a fragment of code of the virtual memory manager of an
operating system in INTEL 8086 assembly language. The objective is to write a fragment of the
assembly language code that calculates the physical (real) address corresponding to a given virtual
address. Write this fragment of code knowing that:
o The virtual address is in AX
o The page size is 256 Bytes
o The page table is in memory at the address PAGE_TABLE. Each entry of the page
table occupies one byte and contains only the page frame number.
o We consider that all pages of the virtual memory are always in the real memory (there
is no page fault)
o The result (real address) should be in BX
o You should use the simplest and minimum number of instructions in order to minimize
the execution time of this code
o If there is a mnemonic of an instruction that you have forgotten use INST1, INST2, etc.
and explain what this instruction does. This will be accepted only if an instruction that
does exactly what you say exists in INTEL 8086.
Explain how your program works and give your commented program.
Explanation
Page 3 of 14
Program
1. (6 points) Write a function SearchList that recursively searches a linked list of integers for a
specified value. The function should return a pointer to the value if it is found; otherwise null
should be returned. Write the code in your language of choice.
Page 4 of 14
2. (8 points) Write a program segment to put N numbers into ascending order using a binary
search tree. Assume that inorder traversal of the tree gives the numbers in ascending order.
Write the code in your language of choice.
Page 5 of 14
c. (3 points) Explain the differences between testing a procedural program and an object-
oriented program.
3. (3 points) Explain the difference between validation and verification, which are important
concepts in software quality.
Page 6 of 14
Part IV: Database Systems (14 points total)
1. (3 points) The two general integrity rules in relational database model are, entity integrity rule and
referential integrity rule. State the rules.
2. (3 points) Transaction recovery is one of the data protection mechanisms used in database
systems. Describe transaction recovery and show how it is implemented.
Page 7 of 14
Participant(Name, Fname, CountryName, HotelName)
Primary key(Name, Fname)
Foreign key HotelName references Hotel,
CountryName references Country
b) (2 points) Assuming that all the other tables are created, write an SQL statement that
creates the WillAttend Table above.
Page 8 of 14
c) (2 points) Write SQL statement that deletes all participants who will not speak and whose
reservations are in 5 star hotels.
d) (2 Points) Write SQL statement that displays all participants who are scheduled to attend
all the sessions.
1) (3 points) Input/outputs in general and disk in particular are the major bottlenecks of the
computer system. Give two very efficient mechanisms used by the operating system to limit
this problem. Explain briefly how each of the mechanism contributes for this purpose.
Page 9 of 14
2) (6 points) Write a program in C programming language that runs on UNIX or Linux systems.
The program requests 10 whole numbers from the user, finds the maximum of the ten
numbers and the sum and displays both. The programs should have three processes. The first
reads the input from the user. The second finds the maximum and displays it. The third
calculates the sum and displays it.
Note
- For the communication and synchronization between the processes you can use:
i. semaphores (you can use any commonly syntax for semaphores not necessarily
found on UNIX/Linux)
ii. signals
iii. pipes
iv. parent/child inheritance
Page 10 of 14
3) (2 points) Many client/server applications such as web servers create one thread to process
the request of a client at the server side than creating a process for each client. Explain briefly
why?
Page 11 of 14
3. (3 points) Discuss media access control techniques in Ethernet and Token ring.
4. (3 points) The two major categories of WAN connections are packet switched and circuit
switched. What are packet switching and circuit switching? Give examples for both.
5. (3 points) Multiplexing is used to make efficient use of high-speed communication lines. What are
the two common forms of multiplexing? Discuss how they work.
Page 12 of 14
Part VII: General questions on ICT in Ethiopia and abroad (15 points total)
Instruction: Attempt any one of the following three questions. If you attempt more than one none
will be accepted.
1. Some years back, the Federal Government and many of the state of the United States of
America sued Microsoft. What was the reason why they sued this company? Microsoft seems
to have escaped the worst. Do you think the World has anything to lose or gain from this trial’s
result? Argument your answer in about 10 lines (average handwriting).
Page 13 of 14
2. What is E-commerce? Do you think it has a great future in the World in general and in Ethiopia
in particular. What are the technical issues that have to be considered if we want to see the
development of E-commerce in Ethiopia. Argument your answer in about 10 lines (average
handwriting).
3. In Ethiopia, nowadays, computer applications are becoming necessity in businesses and office
environments. However, there are many problems associated with the use of local languages in
computing. What are the situations in using local languages like Amharic, Afan Oromo, Tigrigna, etc.
in computing environment? Give specific examples of the problems and their impact. Suggest
solutions on how we can overcome such problems. Present your answer in about 10 lines (average
handwriting).
Page 14 of 14
ADDIS ABABA UNIVERSITY,
FACULTY OF INFORMATICS
Full Name :
Grade Obtained :
Important Note
• Write your name only on this page. Writing your name on the other pages
will automatically disqualify you from this exam.
• Check that you have 16 different pages (including this cover page).
• Any person found cheating will automatically fail the entrance exam
• Use the back of your question papers as rough papers. If you have used all
the backs of your papers you can request for rough papers. Using other non
authorized papers will be considered as cheating.
• Answer neatly to all the questions on the space provided on the question paper
• Write short, and grammatically and logically correct sentences
Page - 1-
Part I: Computer organization and assembly (7 points total)
1. (One point) What is the importance of having a hierarchy of memory instead of a single memory in the
computer architecture?
2. (One point) What is Microprogramming? What are the advantages and drawbacks of microprogramming
compared to hardwired programming?
3. (One point) Explain briefly how the buses are used for the communication between several components of a
computer (Example: CPU and memory)
Page - 2-
4. (4 points) Write two assembly language subroutines for 8086 architecture that will respectively encrypt and
decrypt data located at memory address $2004 using the famous Cesar’s encryption algorithm. Cesar’s
encryption algorithm consists of shifting every letter two positions to the right in the alphabet. For decryption,
the encrypted letter will be shifted by two positions to the left in order to obtain the original letter. For the
special cases of ‘y’ and ‘z’, they will be encrypted as ‘a’ and ‘b’ respectively.
For example: ‘a’ will be encrypted to ‘c’, ‘b’ to ‘d’…’z’ to ‘b’ etc. Therefore, the word “hi” will be encrypted
as “jk”.
Page - 3-
Part II: Programming (17 points total)
1.
a. Define a recursive function.[1 points]
b. Write a recursive function that computes the greatest common divisor (GCD) of two positive
integers.[5 points]
2.
a. Write a function that accepts a positive integer and displays the digits of the number in reverse
order.[3 points]
Page - 4-
b. Analyze your subprogram for big O.[ 1 points]
Page - 5-
Part III: Software Engineering (14 points total)
1.
a. Define Formal Software Specification. (1 pt.)
b. Though the idea of Formal Specification to software is novel, it is not widely used in the
software industry. Describe the reasons behind this.
(2 pts.)
2.
a. Define software system design. (1 pt.)
b. Compare and contrast function-oriented and object-oriented design methods. (maximum of four
lines for each design method). (3 pts.)
Page - 6-
c. What are the three most important design goals during the design of an interactive system which
is to be used by non-computer literate users? (2 pts.)
3.
a. Define regression testing. (1 pt.)
Page - 7-
Part IV: Database Systems (14 points total)
1. (2 points) Why is indexing very important in databases?
2. (2 points) Explain what is a view in relational databases and for what purpose it is us ed?
3. (2 points) How can a Database administrator manage the security of the database using SQL commands?
4. A computer dealer maintains the database of all types of computers and peripherals that he sells to
customers.
The following are the database schema and consists of four tables.
Page - 8-
The Product table gives the manufacturer, model number and type (PC, Laptop, or Printer) of various products.
Assume that model numbers are unique over all manufacturers and product types. The PC table gives for each
model number that is a PC the speed (of the processor, in megahertz), the amount of RAM (in megabytes), the
size of the hard disk (in gigabytes), the speed and type of the removable disk (CD or DVD), and the price. The
Laptop table is similar, except that the screen size (in inches) is recorded in place of information about the
removable disk. The Printer table records for each printer model whether the printer produces color output
(true, if so), the process type (laser, ink-jet, or bubble), and the price.
Using the above information answer the queries below:
i) (1 point) Write an SQL statement that give the manufacturer and speed of Laptops with hard disk of at least
thirty giga bytes.
ii) (2.5 points) Write an SQL statement that finds the manufacturer of the color printer with the lowest price.
iii) (1.5 points) Write an SQL statement that find, for each different speed the average price of a PC.
Page - 9-
5. (3 points) A database is being constructed to keep track of the teams and games of EURO 2004. A team has
a number of players. It is desired to keep track of the players participating in each game for each team that
they played in a game and the result of the game.
Design an ER-schema diagram for this application. Stating any assumptions you make.
Page - 10-
Part V: Operating system (14 points total)
1. (3 points) Explain why a time-sharing operating system is not suitable for applications with hard real time
requirements.
2. (2 points) How can processes communicate in a distributed system where there is no shared memory?
3. (4 points total) In modern operating systems, we can run programs with huge memory requirements even
on computers with small amounts of RAM.
i) What techniques make this possible?
4. (3 points total) Suppose a brand new kind of printer is invented this week. Even though this printer didn’t
exist when Windows 98 was released, we may still be able to configure a computer running Windows 98 so
that it can print documents to this printer.
i) What change, if any, would you have to make to the system to allow it to print to this new printer?
ii) Explain how the operating system has been designed to run independently of device-specific details.
5. (2 points) You have probably had the experience of trying to read a file from a floppy disk and having the
operating system tell you that the diskette is unreadable. What do you think is the most common reason for
this failure?
Page - 11-
Part VI: Networking (14 points total)
1. (2 points) Describe the advantages and the disadvantages of fiber optics cable compared to copper cables
for computer communications?
2. (2 points) Explain what Ethernet is? How it solves the collision problem?
Page - 12-
4. (2 points) Explain the fundamental differences between a hub and a switch.
A
111.222.111.222
B3-E4-88-03-A1-DB
111.222.111.221 222.111.222.112
56-82-4F-3D-90-66 9A-02-33-7C-DD-42
Router
E
222.111.222.111
45-3D-C9-30-D2-86
i) (2 points) Write down an IP address for each interface at all hosts and routers in the network. The IP
addresses for A and E are as given. You should assign IP addresses so that interfaces on the same
network have the same network-part of their IP address. Indicate the number of bits in the network-part
of this address.
ii) (2 points) How do A, E and the router determine the IP addresses needed for an IP datagram moving
from A to E?
Page - 13-
Part VII: General questions on ICT in Ethiopia and abroad (20 points total)
any two of the following five questions within the available spaces.
Instruction: Attempt
The following will be considered for the grade: Quality of language, Writing skills, Correctness and
Quality of arguments and Neatness.
1) What are Open Source Software (OSS) and proprietary software? Give two examples of OSS and two
examples of proprietary software. What are the main differences between the two? Do you think OSS is
good for Ethiopia? Explain.
2) Ethiopian audio-visual artists won a major battle this year? What is it? Do you think it has any
relevance for Information and Communication Technology professionals? Explain.
3) Spams are becoming a major problem for internet users. Describe what spams are, what are the
problems they cause and what solutions exist for individuals. Propose ideas on how spams can be
eliminated (or at least highly limited) from the Internet in the future.
4) Describe the Weredanet and the SchoolNet project of the Ethiopian Government. What are the
opportunities and the challenges ahead?
5) Microsoft is going to develop an Amharic version of Windows XP and Microsoft Office. There is
already an Amharic version of Linux. Do you think that this evolution is very important for Ethiopia?
Explain.
Page - 14-
First chosen question (write just the number): _________
Answer below
Page - 15-
Second chosen question (write just the number): _________
Answer below
Page - 16-
Addis Ababa University
Faculty of Informatics
Department of Computer Science
Name: _______________________________________________
Instructions
1. Read the instructions and the questions carefully.
2. Write your name only on this page. Writing your name on the other pages will automatically disqualify you
from this exam.
3. Answer all questions eligibly on the spaces provided on the question papers. Please make sure that
sentences are short, grammatically and logically correct. You can use the back side of each paper when
space is not sufficient. In such a case, please indicate so.
4. This examination booklet consists of 10 pages (excluding this cover page). Make sure that the question
papers are numbered consecutively and that no question papers are missing or replicated.
5. Cheating is strictly prohibited. Any person found cheating will be automatically disqualified from this
exam.
6. Use only the rough papers provided. Using other unauthorized papers will be considered as cheating.
For Office Use Only
Marks
Page -1-
3. Answer the following questions.
a. Define a binary tree. (2 pts)
b. Explain array representation of a binary tree. Illustrate your answer by an example. (4 pts)
c. What are binary tree traversals? Give their recursive algorithms. (6 pts)
Page -2-
4. For each of the following three multiple choice questions, circle the letter of the correct answer. (1 pt each)
i. Which of the following is true about structured programming or structured problem solving?
a. The problem is divided into a set of time dependent/sequential statements that determine which
part is executed how many times and how long.
c. The language gives emphasis to data structures needed in solving the given problem.
d. All except c.
a. The problem will have a known solution if each iteration (calling) leads the problem to a case
where we know how to solve.
b. Even if the solution is inefficient because of performance and storage reasons, it is recommended
as it increases the readability of the program than the iterative counter part.
iii. In Ethiopia, every citizen is called with his/her name rather than his/her family's name as is the case in
most other countries. It is possible that the name of a person, say, "XYZ" to be the same as the name
of his/her grandfather. In a gathering where only children exist, the name XYZ is meant to refer to the
child rather than the grandfather. Which of the following scope rule represents t he above hypothesis?
c. XYZ can be both global and local. When it is used in the local context, it is given priority.
Page -3-
6. In enterprise applications development, securing data from disclosure to unauthorized users is one of the
challenges. One means of tackling the challenge is to encrypt before sending and decrypting at the
receiving end with the same key. Write two functions Encrypt and Decrypt that accept a string and a key so
as to encrypt and decrypt the text. The encryption algorithm adds 1 to the ASCII value of each character
and subtracts one from the ASCII value of each character for decryption. (8 pts)
Hint: if one wants to send “Hello”, it is “Ifoop” that is sent and when decrypted it will be Hello.
Page -4-
Part II: Operating Systems and Computer Architecture (25 points)
1. Describe three features which might make one process scheduling algorithm preferable to another. (3 pts)
2. What distinguishes a good page replacement algorithm from a bad page replacement algorithm? (3 pts)
3. In general terms, give two different ways of solving the problem of deadlock. (2 pts)
4. When a UNIX process forks a child process, name one thing the parent and child processes have in
common, and two things the parent and child processes don’t have in common. (3 pts)
5. Give two advantages of RAM over hard disk, and two advantages of hard disk over RAM. (2 pts)
Page -5-
6. What is the basic advantage of using interrupt-initiated data transfer over transfer under program control
without an interrupt? (4 pts)
7. The purpose of the communication link is to resolve the differences that exist between the central computer
and each peripheral. List any two such differences. (4 pts)
8. Compare and contrast physical segments and logical segments in Memory Address Space (MAS). (4 pts)
Page -6-
Part III: Database Management Systems (20 points)
1. How do you tackle a database designing problem that involves many-to-many relationship in the context of
RDBMSs? (4 pts)
2. The Ethiopian Athletics Federation wants to keep track of the records of Ethiopian athletes who are taking
part in International competitions. To this effect, the following relations are identified:
RecordHolder_Info(AID, CID )
Entries in the first two tables are mandatory, whereas entries in the third table may or may not exist for an
athlete as it depends on whether an athlete has won a competition with a new record or not.
b. Are all the above relations in 2NF? Justify your answer. (3 pts)
Page -7-
c. Write an SQL statement that computes the total number of records held by an athlete. (2 pts)
d. Write an SQL statement that finds the best time of an athlete on a specific distance out of the
competitions that he/she has taken part. (3 pts)
e. Write an SQL statement that returns a query output containing list of names of athletes who took part
in the competitions held in “Boston”, USA. (2 pts)
3. Explain what new or emerging class(es) of applications that RDBMSs have failed to cope with or manage.
(3 pts)
Page -8-
Part IV: Networking (20 points)
1. What are the two categories of transmission media? List all possible transmission media in each category
and briefly describe their characteristics. (7 pts)
2. Consider two LANs, one based on the Ethernet protocol (i.e., IEEE 802.3) standard and the other one
based on the Token Ring protocol (i.e., IEEE 802.5) standard.
a. What is the biggest conceptual difference between the two LANs when it comes to handling
collisions? (3 pts)
b. Suppose all stations connected to both LANs have information to transmit. Which of the two LANs is
the most “fair”? Motivate your answer. (3 pts)
Page -9-
3. Distinguish between packet switching and circuit switching. Which one is the most appropriate method for
computer networking? Why? (4 pts)
4. Distinguish between physical (MAC) address and IP address. At which layers of the OSI reference model
is each used? (3 pts)
Page -10-
Department of Computer Science
Faculty of Informatics
Addis Ababa University
Name: ____________________________
____________________________________________
___________________
___
Instructions
1. Read the instructions and the questions carefully.
2. Write your name only on this page. Writing your name on the other pages will automatically disqualify
you from this exam.
4. This examination booklet consists of 11 pages (excluding this cover page). Make sure that the question
papers are numbered consecutively and that no question papers are missing or replicated.
7. Switch off your mobile phones. You are not allowed t o use a mobile for any purpose.
Marks
Page -1-
1.3 Write a pseudo code for a function file_copy
function file_copy that copies the content of one file to a new file. The function
takes one argument, original_file, which is the path to the file to be copied and returns the name of the new
file. If an error occurred, NULL should be returned. The function will have the following signature:
(7 points)
To write the function, use the following built-in pseudo functions for file manipulation:
fopen( file_path : string, mode : char ) : integer – opens the file whose path is passed to it as an argument
and returns a file handle and sets the read pointer at the first byte of the file. On error, it returns -1. mode
indicates the mode in which the file is opened and it can take one of the following values: r, w which stand
for read and write, respectively.
fclose( file_handle
file_handle : integer ) – closes the file whose file handle is passed to it as an argument. On error, it
returns -1.
fread( file_handle : integer ) : ByteStream – reads up to 1 KB of stream of bytes starting from the current
position of the read pointer. On error, it returns -1.
fwrite( file_handle: integer, data: ByteStream) : integer – writes up to 1 KB of stream of bytes to the file
whose handle is passed as an argument at the current end of file. On error, it returns -1.
eof ( file_handle : integer ) : boolean – returns TRUE if end of file is encountered, otherwise returns
FALSE.
Page -2-
The answer for question 1.3 may continue on this page.
Page -3-
1.4 Consider the following binary search tree: If the root node, 50, is deleted, which node will become the
new root? (4 points)
Answer: __________________________
1.5. Given the sorting algorithm represented in the following pseudo code, attempt the questions that follow.
Assume A has n elements, where the first index is 1 and the last index is n.
1: for i ← n-1downto 1
2: begin
3: sorted TRUE
←
4: for j ← 1 to i
5: begin
6: if A[ j] < A[ j + 1] then
7: SWAP( A[ j], A[ j + 1])
8: sorted FALSE
←
9: end
10: if sorted then return
11: end
a. What is the best case for this algorithm? What is the best case computing time in “big O” notation? (3
points)
b. What is the worst case and corresponding computing time for this algorithm? (3 points)
c. What is the name of the sorting algorithm represented with the above pseudo code? (3 points)
Page -4-
1.6 Consider a linked list with data values sorted in descending order. The following is given as a sample.
First 20 15 9 5 3
Write an algorithm that inserts an element in the appropriate position. Your algorithm must handle all the
special cases. Make your writing clear; otherwise marks will be deducted. (5 points)
Page -5-
Part II: Computer Architecture and Operating Systems (25 points)
2.1 For interactive operating systems, write the advantages of preemptive scheduling algorithms over the non-
preemptive scheduling algorithms. (3 points)
2.2 Explain why a cache memory, in addition to RAM (or primary memory), is needed in computer systems. (2
points)
2.3 In process swapping, write briefly how important process relocation is. (3 1/2 points)
2.4 Give two possible methods that are used to reduce disk access time. (2 points)
2.5 Consider the Intel 8086/8088 microprocessor architecture to answer the following questions: (3 points)
a. What is the name of the unit responsible for getting the instructions from memory and loading it in the
Instruction Queue for execution? _____________________________________________________
b. What type of addressing mode represents the instruction MOV CL, [BX][DI]+8 ?
______________________________________________________
Page -6-
2.6 For each of the following questions, circle the letter of the correct answer. (1 point each)
i. The amount of time required to read a block of data from a disk into memory is composed of seek
time, rotational latency, and transfer time. Rotational latency refers to
b. the time it takes for the read-write head to move into position over the appropriate track.
c. the time it takes for the platter to rotate the correct sector under the head.
c. Input/Output activities.
d. internal timers.
f. all except a.
2.7 If a magnetic disk has 100 cylinders, each containing 10 tracks of 10 sectors, and each sector can contain
128 bytes, what is the maximum capacity of the disk in bytes? _______________________ (2 point)
2.8 The computer system bus is made up of three independent bus types. What are they? (3 points)
2.9 A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory
address if the smallest addressable memory unit is a word? _____________________ (2 point)
2.10 Whose responsibilities are the following tasks to the instructions of the computer system? ((a)Execution
Unit or (b)Bus Interface Unit); Write a or b on the spaces provided: (1/2 point each)
Fetching: __________________
Pre-fetching: __________________
Decoding: __________________
Execution: __________________
Memory Address Generation: __________________
Page -7-
Part III: Database Management Systems (20 points)
3.1 Based on the description given below, answer the questions that follow.
The Cheapest Car Company sells new and used cars from different makers such as Ford, Volvo and Toyota
and of different models such as Camry, Falcon, Corolla, Carina. custNo, serialNo and staffNo are the sole
keys of Customer, Car and Staff , respectively. Customers make orders to buy cars; a customer can make
several orders. Each order has a unique order number ( orderNo) and only one car is ordered in one order.
An order is processed by one staff member.
Attribute amount_paid of relation Order is the amount that a customer pays for an order; a Customer may
not pay in full for the order. The other attributes are self-explanatory.
b. Give the foreign keys in Order and the relevant referential integrity constraints. (2 points)
ii. List the details of customers whose name contains the string “Wolde”. (2 points)
Page -8-
iii. Cars with price greater than Birr 280,000 are luxury cars. List the customer number, name and
address of customers who have ordered more than one luxury car. (3 points)
iv. List the name and position of staff members who have only sold cars to customers living in the
cities “Addis Ababa” or “Mekelle”. (3 points)
3.2 When is the concept of a weak entity used in database modeling? (2 points)
3.3 Discuss the various reasons that lead to the occurrence of null values in relations? (2 points)
3.4 What is a data dictionary? Use an example to explain the type of information that is kept in the data
dictionary. (2 points)
Page -9-
Part IV: Computer Networks and Data Communications (20 points)
4.1 Compare and contrast virtual circuit switching and datagram switching based on factors such as
addressing (addressing information in every packet), routing and effects of node failures. (3 points)
4.2 For each of the following questions, circle the letter of the correct answer. (1 point each)
ii. In a data communication network, a sender has a sliding window of size 15 and the first 15 packets
have been sent. The first ACK received by the sender was ACK 5, which frame(s) has the receiver
received?
a. Frame 5 b. Frame 4 c. Frame 0 to 2 d. Frame 0 to 4
4.3 Consider the TCP/IP model. Write the name of the layer that is responsible for each of the following tasks.
(1 point each)
Page -10-