0% found this document useful (0 votes)
22 views

Case_study_set2

Uploaded by

tsaydaniel80
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Case_study_set2

Uploaded by

tsaydaniel80
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

REPUBLIQUE DU CAMEROUN REPUBLIC OF CAMEROON

Paix-Travail-Patrie Peace-Work-Fatherland
------- -------
MINISTERE DE L’ENSEIGNEMENT SUPERIEUR MINISTRY OF HIGHER EDUCATION
------- -------
COMMISION NATIONALE D’ORGANISATION DE NATIONAL COMMISSION FOR THE ORGANISATION
L’EXAMEN HIGHER NATIONAL DIPLOMA EXAM (HND) OF THE HIGHER NATIONAL DIPLOMA EXAM (HND)
------- -------

Higher National Diploma Exam-June 2021 Session


Specialty/Option: Software Engineering
Paper: Case Study
Duration: 6 hours Credit: 14
Instructions: Answer all questions.

SECTION A: ALGORITHM AND PROGRAMMING. (50 marks)


I- DATA STRUCTURE AND ALGORITHMS (10 marks)
1. a. Write a structured pseudocode that corresponds to the flowcharts below: (3 marks)

b. Display how you can manually execute the above flowchart, after the value of n has been read (2 marks)
as n =5. Display the output obtained.

2. The data below depicts the steps taken by a certain sorting algorithm to sort the list of integers:
88, 46, 25, 11, 18, 11 and 22. Study the data and answer the questions that follow.
INPUT: [88, 46, 25, 11, 18, 11, 22] // (initial list)
Pass 1: [46, 25, 11, 18, 11, 22,| 88] Pass 2: [25, 11, 18, 11, 22, |46, 88]
Pass 3: [11, 18, 11, 22, |25, 46, 88] Pass 4: [11, 11, 18, |22, 25, 46, 88]
Pass 5: [11, 11, |18, 22, 25, 46, 88] Pass 6: [11,| 11, 18, 22, 25, 46, 88]
OUTPUT: [11, 11, 18, 22, 25, 46, 88] // (sorted list)

Page 1 | 6
a. State which of the sorting algorithm is applied on the set of data above, and explain its working (2 marks)
principle.
b. The size of the input is 7 and results in 6 passes. In the first pass we have (7-1) comparisons (3 marks)
and so on… The total running time of this algorithm is obtained by summing up the terms
representing each comparisons. If the size of the input list is now n,
𝒏(𝒏−𝟏)
Show that the total number of comparisons is T(n) = ∑𝒏−𝟏
𝟏 (𝑲) = and Explain why the
𝟐
2
time complexity for the above algorithm is O(n ) or a quadratic complexity.
II- STRUCTURED PROGRAMMING (15 marks)
1. Copy and fill the table below (2 marks)
Expression/Operation Types of operator used Result
A= (2 == 4) && (5!= 1) A=?
B= (7 > 1) || (9 < 1) B=?
C= !(9 == 4) C=?
m = 9, x = m++ m=? x=?

2. The code snippet below shows the definition of a recursive function called mystery. The final line
of code displays the output returned when mystery is called with an argument of 4.
1 function mystery(n) {
2 if (n = = 0)
3 return 1;
4 else return n *mystery(n-1);
5 }
6 // main program
7 printf(“%d”, mystery(4));
a. What makes the function mystery a recursive function? (1 mark)
b. What difference do you make between recursion and iteration? (2 marks)
c. Which value is displayed when the main program calls the mystery function at line 7? (1 mark)
d. Replace the name mystery of the function by an appropriate one, considering the value in c. (1 mark)
e. Write the iterative counterpart of the mystery function. (2 marks)

3. What difference do you make between passing parameters by value and by address? Illustrate (3 marks)
your answer with a code snippet.
4. Write a code snippet that reads and displays the content of a 2-dimenssional array in C language. (3 marks)

III- OBJECT ORIENTED PROGRAMMING (15 marks)


1. Define the following object oriented concepts: encapsulation, inheritance. (2 marks)
2. What is the use of the scope resolution operator in C++? (2 marks)
3. What difference can you make between procedural and object oriented programming approach? (2 marks)

4. Consider the incomplete C++ program below. The program request the user to enter a number,
an operator, and another number. It then carries out the specified arithmetical operation: adding,
multiplying, or dividing the two numbers. (It uses a switch statement to select the operation).
Finally it displays the result. When it finishes the calculation, the program ask if the user
wants to do another calculation. The response can be ‘Y’ or ‘N’.

Page 2 | 6
1. #include<iostream>
2. //#include<conio.h>
3. using namespace std;
4. class Calculator {
5. float m,n; // To store the 2 operands
6. char oper; // To store the operator
7. double ans; // To store the answer of the operation
8. void sum();
9. void sub();
10. void mul();
11. void div();
12. void disp(); // To display the answer
13. public:
14. void input(); // to input operands and operator
15. void evaluate();
16. };
17. void Calculator::input() {
18. // code to be implemented out of the class
19.
20. }
21.
22. void Calculator::evaluate() {
23. switch (oper)
24. {
25. // call the function that correspond to the operator switched and display the result.
26. }
27. }
28.
29. void Calculator::disp()
30. {
31. cout<<"Answer = "<<ans;
32. }
33. int main( )
34. {
35.
36. return 0;
37. }

We assuming that the process of writing the member functions sum(), sub(), mul(), div() are the
same.
a. Write the bodies of the member functions input(), sum() and evaluate(). (4 marks)
b. Guess an error message the compiler can generate if we attempt to initialize an object in this (1 mark)
manner: obj.m=10, obj.n=2 and obj.oper =''+'' in the main function.
c. Write the main function, where you create an object of type Calculator, call the appropriate (4 marks)
function to set the member variable of the created object, call another appropriate member
function to perform the calculation and display the result. NB: the process can be repeated
as many times until the user decide to quit the program.

Page 3 | 6
Sample output below:
Enter first number: 3 Enter first number: 4 Enter first number: 5
Enter operator: + Enter operator: / Enter operator: *
Enter second number: 2 Enter second number: 2 Enter second number: 4
Answer = 5 Answer = 2 Answer = 20
Do another (Y/N)? Y Do another (Y/N)? y Do another (Y/N)? N

IV- OOM-UML (10 marks)


1. What is the purpose of modeling? (1 mark)
2. What is Object Oriented System development methodology? (1 mark)
3. What is the main advantage of object-oriented development? (2 marks)
4. List out the components of Object-Oriented Analysis and Design. (2 marks)

5. Draw a class diagram representing a book defined by the following statement: “A book is (4 marks)
composed of a number of parts, which in turn are composed of a number of chapters. Chapters
are composed of sections.” Add multiplicity to the class diagram you will produce, and also
include some possible attributes.

SECTION B: DATABASE DEVELOPMENT AND ADMINISTRATION (20 marks)


1. Explain the following database constraints: Entity integrity constraint and referential integrity (2 marks)
constrain.
2. What do you understand by normalization? List the types of anomalies that should be avoided (2 marks)
when designing a database?

3. Consider the following relation:


Articles(ID, title, journal, issue, year, startpage, endpage, TR-ID)
It contains information on articles published in scientific journals. Each article has a unique ID, a
title, and information on where to find it (name of journal, what issue, and on which pages). Also,
if results of an article previously appeared in a “technical report” (TR), the ID of this technical
report can be specified. We have the following information on the attributes:
• For each journal, an issue with a given number is published in a single year.
• The endpage of an article is never smaller than the startpage.
• There is never (part of) more than one article on a single page.
The following is an instance of the relation: Articles
ID title journal issue year startpage endpage TR-ID
42 Cuckoo Hashing JALg 51 2004 121 133 87
33 Deterministic Dictionaries JALg 41 2001 69 85 62
33 Deterministic Dictionaries JALg 41 2001 69 85 56
39 Dictionaries in less space SICOMP 31 2001 111 133 47
57 P vs NP resolve JACM 51 2008 1 3 99
77 What Godel missed SICOM 51 2008 1 5 98
78 What Godel missed Nature 2222 2008 22 22 98
a. Based on the above, indicate for each of the following sets of attributes whether it is a key (2 marks)
for Articles or not: 1. {ID}; 2. {ID, TR-ID}; 3. {ID, title, TR-ID} 4. {title}; 5. {title, year};
6. {startpage,journal,issue}
1 2 3 4 5 6
KEY
Not a KEY

Page 4 | 6
b. Based on the above, indicate for each of the following potential functional dependencies, (2 marks)
whether it is indeed a FD or not: 1. {ID}→{title}; 2. {startpage}→{endpage};
3. {journal issue}→{year} 4. {title→ID}; 5. {ID}→{startpage endpage journal issue};
6. {TR-ID}→{ID}
1 2 3 4 5 6
FD
Not a FD
c. Based on (a) and (b), perform normalization into BCNF, and state the resulting relations. (3 marks)
d. Reverse back the Model obtained as result in (c) to design its corresponding ER-Model. (3 marks)
e. Indicate for each of the following queries, how many tuples would be returned if it was run (2 marks)
on the instance of Articles.
1.SELECT ID FROM Articles WHERE year<2006;
2.SELECT DISTINCT ID FROM Articles WHERE year<2006;
3.SELECT AVG(year) FROM Articles GROUP BY journal;
4.SELECT ID FROM Articles WHERE title LIKE'%d';
1 2 3 4
Number of tuples

4. Consider the relations Authors(auID,name) and Authoring(articleID,authorID), containing


information on names of authors, and who is authoring which papers, respectively, in Articles.
a. Write an SQL query that returns for each article, its ID, title and the number of authors. (2 marks)
b. Write an SQL query that returns the titles of articles authored by 'Robert Johnson'. (2 marks)

SECTION C: WEB DESIGN (15 marks)


1. What are the various methods to pass data from one web page to another web page? (2 marks)
2. Briefly describe each of the following web languages including their file extensions: HTML, CSS, (4 marks)
JavaScript and PHP
3. What is the difference between ID and class in CSS? Write some code snippets to describe it. (2 marks)
4. Discuss HTTP and HTTPs. Explain the two commonly used methods for a request-response (3 marks)
between a client and server.
5. What is a dynamic URL? Give the various parts of the following URL: (2 marks)
http://mydomain.com/myres.php?fname=Paul&job=Software%20Engineer
6. Differentiate between Internet and the web. What is Internet hosting service? (2 marks)

SECTION D: NETWORKING (15 marks)


1. A business has a customer services section. The business is considering a new Local Area
Network (LAN) for this section.
The following are some comments made by the Chief Executive to the IT Manager.
• “I am concerned that only the staff in the Customer Services team should have access to the
LAN.”
a. State what authentication technique will be used for this. (1 mark)
b. Identify what hardware will be in place to restrict the access to the LAN. (1 mark)
• “I understand if the network is to be a wired network, there is a choice about the type of
cabling used.”
c. Name and describe two types of cabling. Suggest a benefit for each cable type. The benefits (3 marks)
should be different
• “Many customer enquiries will be dealt with over the World Wide Web; so each computer

Page 5 | 6
in the LAN needs access to the Internet”.
d. Name the additional hardware needed to provide access to the Internet. (1 mark)
• “With the Internet connection, I am concerned that we will get unauthorized access to our
LAN.”
e. Name the hardware and/or software needed to prevent unauthorized access. (2 marks)
• “Customer Services staff must be able to get access to a centralized store of customer data.
Our business deals with thousands of customers. They produce millions of transactions.”
f. Explain what hardware and software will be needed to enable this. (2 marks)

2. What is the address space of a 32-bit addresses IPv4? (1 mark)


3. List the three common notations to show an IPv4 address (1 mark)
4. a. Change the following IPv4 addresses from binary notation to dotted-decimal notation. (1 mark)
10000001 00001011 00001011 11101111
b. Change the following IPv4 addresses from binary notation to hexadecimal notation. (1 mark)
10000001 00001011 00001011 11101111
c. Find the class of each address: 227.12.14.87 (1 mark)

Page 6 | 6

You might also like