The Open University of Sri Lanka
Faculty of Engineering Technology
Department of Electrical and Computer Engineering
Study Programme : Bachelor of Technology Honours in Engineering
Name of the Examination : Final Examination
Course Code and Title : EEX3417 Software Development for Engineers
Academic Year : 2021/2022
Date : 20 february 2022
Time : 14.00 to 17.00 hrs
Duration : 3 hours
General Instructions
1. Read all instructions carefully before answering the questions.
2. This question paper consists of four (4) questions in nine (9) pages.
3. Answer all four questions.
4. Answers for each question should commence from a new page.
6. This is a Closed Book Test (CBT).
7. Answers should be in clear handwriting (you can use a pencil and eraser to write programs) .
8. Do not use red colour pens.
9. Use attached program 1, program 2 and figure 2 for answering the questions (i), (ii) in
question 1 and (i) in question 2.
10. Attach program 1, program 2 and figure 2 to your answer sheet.
Question 01
(i) Following program creates a 2D array from the given matrix and prints it. Check the data
type ,name and size of the matrix and write answers to ( a),( b), ( C) and (d).
Matrix
______________________________________________________________________________
#include <stdio.h>
int main()
{
int i=0;
int j=0;
int N= ______;
int M= ______;
____________
for(i=0;i<=N;i++)
{
for(j=0;j<=M;j++)
{
printf("%.2f ",a[i][j]);
}
printf("\n");
}
return 0;
}
______________________________________________________________________________
(a) Write the value of N in C program [1 marks]
(b) Write the value of M in C program [1 marks]
(c) Write the C program code to initialize the above matrix [3 marks]
(d) Draw a flowchart for the loop within the box. [5 marks]
2/9
(ii) Using the flowchart in figure 1, write the C program by filling in the blank in the
Program 1 in the page 7 [20 marks]
Figure 1. Flow chart
(iii) This question is based on the structures and characters in C.
The structure car has following fields
● reg_no (data type char, length=8)
● manu_company (data type char, length=15)
● model (data type char, length=10)
● colour (data type char, length=10)
● manu_year (data type int)
● no_door (data type int)
Read the following description and fill in the blanks using C program codes in Program 2 in
page 8. [10 marks]
1. Complete car structure
2. Create a struct variable called “c1” and initialize it to zero. (hint-assign {0})
3. Add “CCC4000” to reg_no (hint-use string copy)
4. Add “Mitsubishi” to manu_company
5. Add “Outlander” to model
6. Add “Black” to colour
7. Add “2016” to manu_year
8. Add “5” to no_door
3/9
9. Print contents of members of struct car “Car registration number”, “Manufacture
company”, “Model”, “Colour”, “Manufacture year”.
10. Add a space to the “manu_company” field (Hint-use string concatenation)
11. Add “model” field to the “manu_company” field.
12. Print the “Car type” by manu_company” field.
Question 02
(i) This question is based on a use case for a University library system. Both students and
staff can use the library. It has two use cases, registration and borrowing.
There are two types of registrations, student registration and staff registration. In the
registration process, there are three sub processes - (1) verify user details, (2) update
records and (3) print library cards . There is another facility of sending a message to
indicate the completion of the library card If the user wants.
In the borrowing process, there are two sub processes- issuing and returning.
Read the above description. Write correct use cases, associations and actors in correct places in
figure 2 in page 9. [8 marks]
(ii) What are the outputs of following phases of the software Life Cycle?
a. Requirement analysis [2 marks]
b. Desin [2 marks]
c. Testing [2 marks]
d. Deployment [2 marks]
(iii) List four (4) types of threats for software security [2 marks]
(iv) List commonly used two (2) types of data encryption methods [2 marks]
4/9
Question 03
Consider the following relational schema for a database called Books that holds data about books
in a library.
Books(Title, ISBN, Author name, Author nationality, Author address, publisher name, publisher
address, total_copies_ordred, Copies_in_hand, publication_date, category, category_description)
Assume the following,
● ISBN number is unique
● A book may have more than one author
● An author may have written more than one book
● Each publisher name is unique and each publisher has a unique address.
● Book Titles are not unique
● Each book has only one publication date and one publisher. A revision of a book is given
a new ISBN.
● Categories are unique. Categories could be: biology, poetry, computer vision etc.
Write clearly, any other assumptions that you need.
(i) Draw an E-R diagram for the given data. Underline the primary key. Clearly show the
cardinality. [08 marks]
(ii) Normalize the data upto 3rd normal form. Indicate the primary keys and foreign keys.
[12 marks]
5/9
Question 04
(i) and (ii) are based on the Flow chart given in Figure 1. Assume you are going to test the code
(i) What will be the test values for Black box testing ? (mention 4 important values)
[3 marks]
(ii) What will be the test cases for Whte Box testing if all branches are to be covered?
[5 marks]
(iii) Read the following description and draw a relevant class diagram
In a University, Details of students include the registration number and program code,
details of staff includes staff id, salary code and department id, Details of both staff and
students (person) include NIC no, name, age, address and date of birth.
A department has a department code and one or more staff members. [12 marks]
6/9
Index No
Question 1. (ii). Program 1
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
//--------------------
float ____(____ N)
{
____________
____________
while___________
{
__________
____________________________/(float) 4;
}
_________________
}
//--------------------
int main()
{
srand(time(NULL));
_______________
_______________
_______________
_______________
____________("Enter the number 1, 2, 3 or 4-> ");
scanf__________________
if_______________
{
_______________
_______________
}
else if_____________
{
_______________
________________
}
__________________
{
________________
________________
}
else if_____________
7/9
{
_________________
_________________
}
printf("m1->_____, m2->_______, return number-> ________",_________________);
return 0;
}
Question 1 (iii). Program 2
#include <stdio.h>
#include <string.h>
struct _____
{
char reg_no[8];
_______________________
_______________________
_______________________
_______________________
_______________________
};
int main()
{
________________________________
________________________________
________________________________
________________________________
________________________________
________________________________
________________________________
//--------------------
printf("Car registration number = __________",c1.reg_no);
_____________________________________________________
_____________________________________________________
_____________________________________________________
_____________________________________________________
______________________________________________________
______________________________________________________
______________________________________________________
______________________________________________________
return 0;
}
8/9
Index No
Question 2 (i)
figure 2
9/9