You are on page 1of 5

Student ID

University of Bedfordshire
School of Computer Science and Technology

Unit Code: CIS016-2, CIS116-2 & PAT001-2

Unit Title DESKTOP APPLICATION DEVELOPMENT & SOFTWARE


ENGINEERING
&
OBJECT ORIENTED PROGRAMMING & SOFTWARE
ENGINEERING
Academic Year 2020-2021

Period of Study SEM 1 Paper 1

Date of Exam: Friday 15th January 2021

Start Time: 09:00

Time Allowed: 3 Hours

Unit Co-Ordinator: Dr Renxi Qiu

Instructions for Candidates

Equipment allowed: None

Materials allowed: None

Additional Instructions: This exam is a closed book examination

SECTION A: ANSWER THREE OUT OF THE FOUR QUESTIONS


SECTION B: ANSWER ALL QUESTIONS IN THIS SECTION
SECTION A IS WORTH 60 MARKS
SECTION B IS WORTH 40 MARKS

Do not open this paper until instructed to do so by the Senior invigilator

CIS016-2/CIS116-2/PAT001-2/2020-21/SEM1/PAPER 1 Page 1 of 5
SECTION A: ANSWER THREE OUT OF THE FOUR QUESTIONS IN THIS SECTION

Question One [20 marks]

Quicksort is an efficient sorting algorithm developed by British computer scientist


Tony Hoare in 1959. One of its implementations is summarised in the pseudo code
below with algorithm “quicksort” and algorithm “partition”:
algorithm quicksort(A, lo, hi) is
if lo < hi then
p := partition(A, lo, hi)
quicksort(A, lo, p - 1)
quicksort(A, p + 1, hi)

algorithm partition(A, lo, hi) is


pivot := A[hi]
i := lo
for j := lo to hi do
if A[j] < pivot then
swap A[i] with A[j]
i := i + 1
swap A[i] with A[hi]
return i
The algorithm “quicksort” divides a list of elements into two parts (called sub-lists)
and performs sorting over the sub-lists recursively.

The algorithm “partition” selects a pivot to partition the list into sub-lists such that all
elements in one sub-list are smaller than the pivot and all elements in the other are
greater than the pivot.

A) Given a list of {51,95,66,72,42,38,62}; illustrate the sorting process specified in the


pseudo code (10
marks)

B) Implement the pseudo code in C# (10 marks)

CIS016-2/CIS116-2/PAT001-2/2020-21/SEM1/PAPER 1 Page 2 of 5
Question Two [20 marks]

A) What will be the output of following code snippet? (8 marks)


class Example0
{
int i;
public sample(int num)
{
i = num;
num = 10;
int val = num * i;
Console.WriteLine(val);
}
}
class Example1: Example0
{
public sample1(int a): base(a)
{
int b = 10;
Console.WriteLine(a + b);
}
}
class Example2: Example1
{
public sample2(int k): base(k)
{
k = 20;
int o = 10 ;
Console.WriteLine(k /o);
}
}
class Program
{
public static void Main(string[] args)
{
Example2 t = new sample2(10);
Console.ReadLine();
}
}

B) Given the code below: (8 marks)


using System;
public class Example3
{
private static void OnTimedEvent(Object source,
System.Timers.ElapsedEventArgs e)
{

CIS016-2/CIS116-2/PAT001-2/2020-21/SEM1/PAPER 1 Page 3 of 5
Console.WriteLine("The Elapsed event was raised at {0}",
e.SignalTime);
}

public static void Main()


{
System.Timers.Timer aTimer;
aTimer = new System.Timers.Timer();
aTimer.Interval = 100;
aTimer.Elapsed += OnTimedEvent;
aTimer.Enabled = true;
Console.WriteLine("Press the Enter key to exit the program at any
time... ");
Console.ReadLine();
}
}

 Explain why the OnTimedEvent method and the Main method must be declared as
static.
 There is one delegate variable in the code, which is it?
 Delegates are like C++ function pointers but are type safe, explain the role of the
delegate in this code?

C) The ADO.NET supports two different programming environments: connected and


disconnected. DataAdapter is used in the connected environment. It contains a set of SQL
commands and a database connection that are used to fill the DataSet and update the
data source. It has a DbConnection property and a DbCommand property. What are these
properties designed for? Show how to generate INSERT, UPDATE, or DELETE
statements from the DbCommand Property automatically?
(4
marks)

Question Three [20 marks]

What are the four design models required for a complete specification of a software
design? Briefly discuss the role of each in software design.

Question Four [20 marks]

In the context of analysis modelling in software engineering, what is an analysis package?


If an analysis package is named as “Environment”, what object-oriented classes can be
included? Please briefly discuss whether an analysis package has the same meaning as a
class inheritance hierarchy.

CIS016-2/CIS116-2/PAT001-2/2020-21/SEM1/PAPER 1 Page 4 of 5
SECTION B: ANSWER ALL QUESTIONS IN THIS SECTION

Question Five [10 marks]


A) Briefly describe the Scrum Methodology, explain its advantages and drawbacks.
(6 marks)

B) What is the main responsibility of a Scrum Master? (4 marks)

Question Six – Mini Case Study [30 marks]


A content management system using WordPress has been set up on an Amazon Elastic
Kubernetes Service (EKS) instance. After a few weeks, you realise that the system is
starting to reach its limits and needs to be scaled up as soon as possible. To carry out the
upgrade, the content management system has to be shut down for a period of time.
Although, this is NOT a good practise for businesses. Continuous service delivery and
continuous system integration are preferred.

Propose a cloud-based solution which avoids the disruption such as shutdown


completely? Elaborate on your cloud-based solution, its corresponding architecture and
operation in detail.

CIS016-2/CIS116-2/PAT001-2/2020-21/SEM1/PAPER 1 Page 5 of 5

You might also like