Uploaded by benyoungobi3

past exam 2

advertisement
University of Bedfordshire
Faculty of Creative Arts, Technologies and Science
School of Computer Science and Technology
OBJECT ORIENTED PROGRAMMING & SOFTWARE ENGINEERING
CIS016-2/2019-20/SEM1/PAPER 1
Date of Exam:
Tuesday 21st January 2020
Start Time:
09:00
Time Allowed:
3 Hours
Unit Co-ordinator:
Dr Renxi Qiu
INSTRUCTIONS TO CANDIDATES:
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
CALCULATORS ARE NOT ALLOWED
DO NOT OPEN THIS PAPER UNTIL INSTRUCTED TO DO SO BY THE SENIOR
INVIGILATOR.
CIS016-2/ /2019-20/SEM1/PAPER 1
Page 1
SECTION A:
SECTION
ANSWER THREE OUT OF THE FOUR QUESTIONS IN THIS
Question One [20 marks]
Good software needs to be understandable, flexible, and maintainable. In the code
snippet, given below, methods belonging to the StartState and the Endstate are
mixed together, therefore the code is not easy to understand and hard to maintain.
Given the class diagram in Figure 1, without losing functionality, remove the If-then(else) statements completely and decompose the states into separated classes?
Provide your answer in C# code.
class Context
{
private int _state;
//0 for StartState; 1 for EndState
public Context(int state)
{ _state = state;
}
public void next()
{
if(_state==0)
{
_state = 1;
Console.WriteLine("Player is moved from start to end");
}
else{
Console.WriteLine("Player stays in the end state");
}
}
public void previous()
{
if (_state == 0)
{
Console.WriteLine("Player stays in start state");
}
else{
_state = 0;
Console.WriteLine("Player is moved from end to start");
}
}
}
CIS016-2/ /2019-20/SEM1/PAPER 1
Page 2
Figure 1 – The class diagram for the proposed solution
Question Two [20 marks]
A) The algorithm of a selection sort divides an input list into two parts:
a sub-list of items which have already been sorted at the front, and a sub-list of items
remaining to be sorted at the end. Initially, the entire list is unsorted, and the sorted
sub-list is empty. To sort in ascending sequence the step by step it follows:
•
•
•
The element with the lowest value is selected and swaps position with the one
at the first position on a list. After the 1st step, the 1st element of the list is
sorted, the rest of the elements are unsorted.
For rest of the list, the element with the smallest value in the remaining
elements is found and placed at the second position. After the 2nd step, the
two elements at the front of the list are sorted, the rest of the elements are
unsorted.
This process is repeated until all elements of the unsorted sub-list are
selected and put into the sorted sub-list.
For a given list of A= {8, 5, 3, 19, 1} to be sorted ascendingly by the selection sort,
what is the state of the list after each of the following steps?
Step 1) The list has one element sorted
Step 2) The list has two elements sorted
Step 3) The list has three elements sorted
Step 4) The list has four elements sorted
CIS016-2/ /2019-20/SEM1/PAPER 1
(8 marks)
Page 3
B) Complete the C# code given below to implement a selection sort
void sort(int a[])
{ // a[] array of a list of elements
….
}
(12 marks)
Question Three [20 marks]
In the context of software engineering, what are the four distinct elements of an
analysis model? Briefly discuss whether it is possible to develop an analysis model
without using all four elements, with a supportive explanation and analysis.
Question Four [20 marks]
What is the Open-Closed Principle (OCP) in component design? Briefly discuss what
a designer should do based on this principle and why it is important.
CIS016-2/ /2019-20/SEM1/PAPER 1
Page 4
SECTION B: ANSWER ALL QUESTIONS IN THIS SECTION
Question Five [20 marks]
A) Describe the main characteristics of the Agile Scrum Methodology?
(8 marks)
B) Provide four distinct responsibilities that are undertaken by the Scrum Master?
(4 marks)
C) What happens in a Sprint Review Meeting?
(4 marks)
D) Provide two distinct advantages and two distinct drawbacks of the Scrum
Methodology
(4 marks)
Question Six [20 marks]
A) A software process is often described as a set of activities whose goal is the
development or evolution of software. There are four generic activities that occur in
all software processes. These are Specification, Development, Validation and
Evolution. Explain what these activities mean in a software development context.
(8 marks, 2 for each item)
B) A Software Process Model is a simplified representation of a software process,
presented from a specific perspective. Name two distinct generic process models
and include application scenarios, the advantages and disadvantages of both.
(8 marks, 4 for each item)
C) CASE (spell out) Tools are software systems intended to provide automated
support for software development/maintenance activities. Software development
CASE Tools are often split into two categories; Upper-CASE Tools and Lower-CASE
Tools. Briefly describe the difference between the two types and provide examples
where appropriate.
(4 marks, 2 for each item)
CIS016-2/ /2019-20/SEM1/PAPER 1
Page 5
Download