Model Exam Version 6
Model Exam Version 6
Model Exam Version 6
Mekanisa Campus
Faculty of Informatics
Department of Computer Science
Model Exit Exam VI CODE MK-006
Software Engineering 3 6
1 Theme 1. System Development Web Programming 6 9
Database Systems 6 12
Total 3 15 27
Computer Programming 6 6
Page | 2
10. What does affected_rows() do?
A. returns the number of rows in the table
B. returns number of updated rows
C. used to filter query injection
D. all
11. Mysqli_connect takes one of the following parameters
A. Database name C. server name
B. port number D. username
12. One is used to display using JavaScrip
A. document.write() D. All
B. window.alert()
C. consol.log()
Which of the following cases is incorrect during database design using ER model of a given scenario?
SELECT student.d, FROM student, course WHERE student. b = course.b AND course.d = 3
A. First, join the two tables with their command filed and apply the select and projection operation in
sequence
B. First, apply the select operation and then join the operation, and finally the projection operation
C. First, apply the projection and then the election operation, and finally the join operation
D. Any order can be efficient
18. Which one of the following is not DML
A. INSERT B. DELETE TABELE C. UPDATE D Drop TABLE
19. Which type of constraint is used to enforce referential integrity?
A. Primary key constraint C. Unique constraint
B. Check constraint D. Foreign key constraint
20. Type of relationship that describes how many entities are participated in the relation
A. Carnality of relationship C. Degree of relationship
B. generalization of relationship D. Specialization of relationship
21. which one of the following is not true about SQL CHECK Constraint
A. The CHECK constraint is used to limit the value range that can be placed in a column.
B. If you define a CHECK constraint on a single column it allows only certain values for this
column.
C. If you define a CHECK constraint on a table it can limit the values in certain columns
based on values in other columns in the row.
D. If you define a CHECK constraint on a single column it allows only certain values for all
columns.
22. Which one of the following is not among the advantages of DBMS
A. Concurrency Control Services C. Recovery Services
B. Authorization Services (Security): D. Data Generation Service
23. Which one of the following schema describes the structure and constraints for the whole database
for a community of users?
A. External schema B. Conceptual schema
4|Page
C. Internal schema D. Physical Schema
24. ___ is a set of principles concerned with how data is structured.
A. Data integrity C. Data definition
B. Data manipulation D. Data control
25. Type of relationship that describes how many entity types are participated in the relation
A. Carnality of relationship C. Degree of relationship
B. generalization of relationship D. Specialization of relationship
26. which one of the following is not true about SQL Primary Key constraint
A. The PRIMARY KEY constraint uniquely identifies each record in a database table.
B. Primary keys must contain unique values.
C. A primary key column contain NULL values.
D. Each table should have a primary key, and each table can have only one primary key.
27. Which one of the following SQL query syntax is used to drop a column from a table
A. ALTER TABLE table_name DROP COLUMN column_name
B. ALTER TABLE table_name DROP column_name
C. ALTER TABLE table_namecolumn_name
D. ALTER TABLE table_name DROP column_name COLUMN
1. If we want a search function to search an array for some value and return either the index
where the value was found, or -1 if not found, which of the following prototypes would
be appropriate?
A. void search(constint array, int target, intnumElements);
B. void search(constint array, int target);
C. int search(constint array[], intnumElements);
D. int search(constint array[], int target, intnumElements);
2. What is wrong with the following code fragment?
constint SIZE =5;
float scores[SIZE];
for(int i=0; i<=SIZE;i++)
{
cout<< "Enter a score\n";
cin>> scores[i];
}
A. Array indexes start at 1 not 0
B. Arrays must be integers
C. Array indexes must be less than the size of the array
D. Should be cin>> scores[0];
5|Page
3. What is the output of the following code fragment?
int i=5;
switch(i)
{
case 0: i=15;break;
case 1: i=25;break;
case 2: i=35;break;
case 3: i=40;
default: i=0;
}
cout<< i <<endl;
A. 15
B. 25
C. 35
D. 40
E. 0
4. What is the value of x after the following code executes?
int x=10;
if(x++ >10)
{
x =13;
}
A. 10
B. 9
C. 13
D. 11
5. Which of the following is not a good reason for choosing a certain loop control?
A. What the loop does
B. The minimum number of iterations of the loop
C. The condition for ending the loop
D. If the loop is in a function
6. What is the output of the following code fragment?
int array[4][4], index1, index2;
for(index1=0;index1<4;index1++)
for(index2=0;index2<4;index2++)
array[index1][index2]=index1 + index2;
for(index1=0;index1<4;index1++){
for(index2=0;index2<4;index2++)
cout<< array[index1][index2] << " ";
cout<<endl;
6|Page
}
A. 0 1 2 3
1234
2345
3456
B. 0 1 2 3
0123
0123
0123
C. 0 0 0 0
1111
2222
3333
D. 0 0 0 0
0123
0246
0 369
7. Consider the following Java Program and then how many times it executes the output
statement?
for (int x=1; x <= 2; x++)
{
for (int y=1; y <= 2; y++)
{
system.out.println (”Welcome”);
}
}
A) 4 B) 2 C) 6 D) 1
8. In java program how to read integer value from keyboard?
Scanner input = new Scanner(System.in);
A. int value = input.nextDouble();
B. double value = input.nextInt();
C. double value = input.nextDouble();
D. int value = input.nextInt();
9. System.out.print("To the screen") is
A. Console display statement
B. GUI display statement
C. Console Reading statement
D. GUI reading statement
10. Which operator is used to access a data field or invoke a method from an object?
A) The dot (.) operator B) The new operator
7|Page
C) The plus (+) operator D) The asterix (*) operator
11. Which of these is correct way of inheriting class shape by class square?
A) class square + class shape {}
B) class square inherits class shape {}
C) class square extends shape {}
D) class square extends class shape {}
12. Given that the java program:
class C1{
privateint x;
void m1( ) {}
protected void m2( ){}
public void m3( ){}
}
public class C2 extends C1{}
Which members of C1 would be accessible in C2 if C1 was a public class?
A. B. C. D.
16. If a complete graph has n vertices, how many edges does it have?
A. n(n-1) C. n(n-1)/2
B. n-1 D. n
17. Which one of the following is true about quick sort?
A. pick one element to use as pivot
B. Partition elements into two sub-arrays
C. Quicksort two sub-arrays and Return results
D. All are correct
18. Assume we have 8 unsorted elements and we need sorted using quick sort start from the
middle, what is the median?
A. 3 B. 4 C. 2 D. 1
8|Page
19. ____________ is one that contains no loops or parallel edges.
A. simple graph C. complete graph
B. multiple graph D. directed graph
20. Suppose that an intermixed sequence of (stack) push and pop operations are performed. The pushes
push the integers 0 through 9 in order; the pops print out the return value. Which of the following
sequence(s) could not occur?
A. 4 3 2 1 0 9 8 7 6 5
B. 4 6 8 7 5 3 2 9 0 1
C. 2 5 6 7 4 8 9 3 1 0
D. 4 3 2 1 0 5 6 7 8 9
21. Given the following declarations, which statement would put the value of 5 in the item part of the first
node in the linked list?
struct Node
{ int item;
Node* link;
};
Node* p;
p= new Node;
A. p.item=5;
B. p->item=5;
C. p=5;
D. item=5;
22. What does the first pass of selection sort do?
24. In order to get the information stored in a Binary Search Tree in the descending order, one should traverse
it in which of the following order?
A. left, parent, right
B. parent, left, right
C. right, parent, left
D. right, left, parent
25. Suppose we are sorting an array of ten integers using some quadratic sorting algorithm. After four
iterations of the algorithm's main loop, the array elements are ordered as shown here:
12 13 14 15 16 11 17 18 19 20
Which statement is correct? (Note: Our selectionsort picks largest items first.)
A. The algorithm might be either selectionsort or insertionsort.
B. The algorithm might be selectionsort, but could not be insertionsort.
C. The algorithm might be insertionsort, but could not be selectionsort.
D. The algorithm is neither selectionsort nor insertionsort.
1. You have an interface on a router with the IP address of 192.168.100.154/27. What is the
broadcast address of the hosts will use on this LAN?
A. 192.168.100.129 C. 192.168.100.159
B. 192.168.100.128 D. 192.168.100.158
2. From question number 7 what is the network address the hosts will use on this LAN?
A. 192.168.100.129 C. 192.168.100.159
B. 192.168.100.128 D. 192.168.100.158
3. From question number 7 what is the number of hosts on this LAN?
A. 30 B. 32 C. 8 D. 16
4. If Admas University main Campus wants to develop a network for main branch that linked
with Mekanisa Campus, what network type is applicable for this situation in order to share
information between the two Campuses?
A) MAN B) WAN C) LAN D)WLAN
5. Which layers of the OSI model are network supporting layers?
A) Session, Presentation, Application
B) Network, Session, Presentation
C) Physical, Datalink, Network
D) Physical, Network, Transport
6. For one computer to send a message to another computer, the source computer must perform
the following steps except
A. Break the data into small sections
B. Add addressing information to the packets identifying the source and destination
computers
C. Accept the data from the NIC
10
D. Deliver the data to the network interface card for transmission over the network
11
15. Routing tables of a router keeps track of
A. MAC Address Assignments
B. Port Assignments to network devices
C. Distribute IP address to network devices
D. Routes to use for forwarding data to its destination
16. When data is encapsulated, which is the correct order?
A. Data, frame, packet, segment, bit
B. Segment, data, packet, frame, bit
C. Data, segment, packet, frame, bit
D. Data, segment, frame, packet, bit
17. Which of the following statements is not the functions of a Transport layer
A. Enables multiple applications to communicate over the network at the same time on a
single device
B. Ensures all the data is received reliably and in order by the correct application
C. Employs error handling mechanisms
D. Delivery of packet from Source to destination
18. What is the purpose of flow control?
A. To ensure that data is retransmitted if an acknowledgment is not received
B. To reassemble segments in the correct order at the destination device
C. To provide a means for the receiver to govern the amount of data sent by the sender
D. To regulate the size of each segment
19. Among the types of hackers __________ is a type of hackers are among the low-abiding
citizens but venture in to illegal activity?
A. Black Hat Hacker
B. Red Hat Hacker
C. Gray Hat Hacker
D. White Hat Hacker
20. Active attacks attempts to alter system resources or affects their operation. It is very difficult
to prevent active attacks absolutely.
A. Active attack B. Passive Attack C. Medium attack D. All
21. Which type of threat destroyed or becomes unavailable or cannot be used.
A. Interruption B. Interception C. Modification D. Fabrication
22. which one describes data cannot be modified undetectably
A. Confidentiality B. Integrity C. Availability D. Authenticity
23. Which one of the following describes that information must be available when it is needed
A. Confidentiality B. Integrity C. Availability D. Authenticity
24. Which one of the following describes that it is necessary to ensure that the data, transactions,
communications or documents are genuine
A. Confidentiality B. Integrity C. Availability D. Authenticity
25. Which one of the following is not ingredients of encryption schema
A. Cipher text B. Secret Key C. Hash Key D. Plaintext
12
Theme 4. Intelligent Systems
1. The expected performance of rational agents at any given point depends on: -
A. Percept Sequence C. Knowledge from Environment
B. Possible Actions D. All
2. Which of the following is an element used to create well defined problems?
A. Goal test function C. Path cost function
B. Successor function D. All
3. The process of finding what sentences are entailed is called ______________.
A. Entailment C. Valid sentence
B. Inference D. Mode
4. The general approach for informed search strategy is called__________.
A. Depth first search C. Best first search
B. A* search D. Depth limited search
5. Which of the following search algorithms property helps to make sure if algorithm
guaranteed to find a solution when there is one?
A. Completeness C. Time Complexity
B. Optimality D. Space Complexity
6. Which of the following heuristic is more powerful guide?
A. Degree heuristic
B. Minimum Value remaining heuristic
C. Least constraining value heuristic
D. All of the above
Theme 5. Computer Architecture and Operating Systems
13
4. Which one of the following is not true?
A. kernel remains in the memory during the entire computer session
B. kernel is made of various modules which can not be loaded in running operating
system
C. kernel is the first part of the operating system to load into memory during booting
D. kernel is the program that constitutes the central core of the operating system
5. Which one of the following errors will be handle by the operating system?
A. lack of paper in printer
B. connection failure in the network
C. power failure
D. all of the mentioned
14
C. It is sent by I/O module to inform the processor when it is ready to exchange data.
D. All except B.
12. Which of the following statements is/are correct in auxiliary memory
A. It stores information that is necessarily in current use.
B. It is faster than main memory
C. It is higher capacity than primary memory.
D. It is volatile storage media.
Theme 6. Compiler and Complexity
F→id
In the predictive parsing table M, of the grammar, the entries M[S, id] and M[R, $] respectively
15
C. (S→FR) and (R→ * S) D. (F→ id) and (R→ €))
7. Consider three decision problems P₁ P₂ and P₃. It is known that P₁ is decidable and P₂ is
undecidable. Which one of the following is TRUE?
A. P₃ is decidable if P₁ is reducible to P₃
B. P₃ is undecidable if P₃ is reducible to P₂
C. P₃ is undecidable if P₂ is reducible to P₃
D. P₃ is decidable if P₃ is reducible to P₂’s complement
8. What type of language do Turing machines generate?
A. Regular languages
B. Context free
C. Recursive enumerable languages
D. Content sensitive
9. Which one of the following is true for NFA machine M to accept a string?
A. All the symbols of input string must be scanned and all the paths must end at an accepting
state.
B. All the symbols of input string may not be scanned but it must reach at some accepting state.
C. All the symbols of input string is scanned and the last state is non-accepting.
D. All the symbols of input string must be scanned and one the paths must end at an accepting
state.
E. None of these
10. The regular expression r = b*ab* + b* represents any string w over {a,b}:
A. starting with b and having no other a’s or having no a’s but only b’s
B. having at least one a
C. having at most one a’s
D. starting with b and ending with a
11. A universal Turing machine is _______
A. Two tape Turing machine C. Reprogrammable Turing machine
B. Single tape Turing machine D. All of these
12. Let X be a problem that belongs to the class NP. Then which one of the following is TRUE?
16
C. If X is NP-hard, then it is NP-complete D. X may be undecidable
Admas University
Faculty of Informatics
Department of Computer Science
Model Exit Exam
Answer Sheet
Sene, 2015
Time allotted: 3:00 hrs
Name _________________________
ID.No._________________________
Section _________________
Answer Sheet
Fundamentals of Software Engineering
1. C 2. B 3. D 4. D 5. D 6. E
Web Programming
7. A 8. C 9. D 10. B 11. C 12. D
Database Systems
13. B 14. B 15. B 16. B 17. B 18. B
19. D 20. A 21. D 22. D 23. B 24. C
25. C 26. C 27. C
Computer Programming
1. D 2. C 3. E 4. A 5. D 6. A
Object Oriented Programming
7. A 8. D 9. A 10. A 11. C 12. A
Design and Analysis of Algorithms
13. B 14. C 15. B 16. A 17. D 18. A
Data Structure and Algorithms
17
Data Communication and Computer Networking
1. C 2. B 3. A 4. A 5. C 6. C
Computer Security
7. D 8. C 9. D 10. A 11. D 12. A
Network and System Administration
13. C 14. D 15. D 16. C 17. D 18. C
19. C 20. A 21. A 22. B 23. C 24. D
Operating System
1. C 2. D 3. A 4. D 5. A 6. C
Computer organization and architecture
7. B 8. B 9. C 10. A 11. C 12. C
1. B 2. B 3. E 4. C 5. C 6. D
Compiler Design
GOOD LUCK!