INF2011 2019FinalExam

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

University of Cape Town

Department of Information Systems

Systems Design & Development (INF2011) Exam

-----------------------------------------------------------------------------------------------------------

Instructions to Candidates

1. This exam is not open book.


2. The exam is out of 150 marks and you have 3 hours. Marks allocated to a
question should be used as an indication of the level of detail expected in the
answer.
3. The exam has THREE sections. Answer all sections in the provided exam
answer books. Each question should be answered on a new page.
4. A case study can be found as an appendix at the end of the question paper. The
case study is to be used in answering questions in Section C.
5. At the end of the exam you must hand-in this question paper, and any additional
answer books used

-------------------------------------------------------------------------------------------------------

For Marking Purposes


SECTION A SECTION B SECTION C Total

/30 /20 /100 /150

Page 1 of 14

C2 General Data Classification


SECTION A: MULTIPLE CHOICE [30]
Answer the following section by selecting the most appropriate answer and writing it
down in your Multiple Choice Question answer sheet.

1.1 Which objects may send queries back to the boundary objects to get more information
from the actors?
a) database
b) controllers
c) boundary
d) data access

1.2 When implementing inheritance, ensure that:


a) the super class object is created before the subclass is created
b) the derived class inherits the base class member variables and member
methods.
c) all of the above are correct
d) only b is correct

1.3 What can we deduce from the following code:


StudentListingForm = new ListingForm(studentController);

a) StudentListingForm is a class
b) ListingForm is a class whose constructor requires a parameter
c) studentController is of type StudentListingForm
d) the code initialises the studentController

1.4 To make the new form a child form, you would use:
a) this = child.MdiParent;
b) MdiParent.child = this;
c) new = child.MdiParent ;
d) child.MdiParent = this;

1.5 If you want to initialize an object dynamically with user given values then:
a) you need to use the default constructor.
b) you need to use the parameterized constructor.
c) implement a class that will achieve this and call the class in the property
methods region
d) all of the above are correct

Page 2 of 14

C2 General Data Classification


1.6 Which of the following illustrates objects that participate in a use case and the
messages that pass between them over time for one use case.
a) class diagram
b) entity relationship diagram
c) use case diagram
d) sequence diagram

1.7 __________is the process of creating products that provide meaningful and relevant
experiences to users.
a) wireframing
b) use case analysis
c) user interface design
d) user experience (ux) design (uxd)

1.8 In a layered architecture, the __________ layer refers to the characteristic of state
that outlives the process that created it.
a) database
b) presentation
c) persistence
d) business

1.9 A(n) __________ is a procedure in your code that determines what actions are
performed when an event occurs
a) region
b) collection
c) event handler
d) method

1.10 A _________ is a set of DataTable objects


a) dataset
b) dataprovider
c) datareader
d) database

1.11 A ________ is used to retrieve data from a data source and populate tables
within a DataSet.
a) dataset
b) dataprovider
c) datareader
d) dataadapter

Page 3 of 14

C2 General Data Classification


1.12 A(n) _________ is a set of named integer constants
a) enumeration
b) variable
c) constant variable
d) data type

1.13 Which of the following focuses on what information is presented to the user
a) controller classes
b) boundary classes
c) data access classes
d) dataprovider classes

1.14 The System.Data namespace


a) provides access to classes that represent the ado.net architecture that lets you
build components that efficiently manage data from multiple data sources.
b) is a sqlcommand object that allows you to specify what type of interaction you
want to perform with a database.
c) performs data definition tasks and data manipulation tasks
d) is used to indicate or specify how the commandtext property is interpreted.

1.15 The System.Data.SqlClient namespace


a) is a collection of constraints in the dataset
b) are elements designed to help you organize your programs and assist in
avoiding name clashes between two sets of code.
c) is the .net data provider for sql server
d) is a container for some classes in much the same way that a folder on your file
system contains files.

1.16 Which of the following does not feature in a detailed sequence diagram?
a) actors
b) objects
c) lifelines
d) forms

1.17 In C# encapsulation is implemented


a) by declaring the variables as private; and defining one pair of public setter and
getter methods or properties to access private variables.
b) by declaring the property methods
c) by defining the data members – the fields
d) by associating a constructor with each class.

Page 4 of 14

C2 General Data Classification


1.18 Allowing a class to have multiple methods with the same name but with a
different signature
a) occurs when both methods must have different parameter types/number/order.
b) is termed function overloading
c) is only possible when you want to execute the same logic but with different
types of argument
d) all of the above are correct

1.19 The following code stipulates the connection string to a datasource:

string ConnectionString = "Integrated Security = SSPI; " + "Initial Catalog=


Northwind; " + " Data source = localhost; ";

What does the following code do?

SqlConnection conn = new SqlConnection(ConnectionString);

a) creates a connection object


b) declares a variable SqlConnection of type conn
c) creates the dataset
d) imports the SQL data access classes

1.20 You can use the ________ event to perform operations such as updating the
data displayed in the controls of the form when the form is triggered
a) activated
b) load
c) closed
d) show

1.21 In C#, Trim()


a) is an example of enumeration
b) is used to remove from the current string all leading and trailing characters.
c) executes a block of code several number of times
d) refer to fixed values that the program may not alter during its execution.

Page 5 of 14

C2 General Data Classification


1.22 What can we assume in the following code:

private Collection<Salmon> salmons ;

a) Salmon is the name of the collection


b) salmons is the name of the collection
c) salmons is the name of the class
d) collection is an access specifier

1.23 What can we assume in the following code:


SalmonDetails = new ListViewItem();
a) new is a method of data type ListViewItem
b) ListViewItem is a method that returns a value of type new
c) SalmonDetails is a method that is being instantiated
d) SalmonDetails is an object of type ListViewItem

1.24 The following code:

foreach (Type var_name in Collection_Object)


{

// Statements to Execute

a) tests the condition of the collection object and then then executes the
statements
b) is the syntax of defining the collection object in c# programming language
c) execute the block of statements for each element in the array var_name
d) is a loop with collection object and a required variable name to access
elements from the collection object.

1.25 To check if the form studentForm does not exists, you would use the code
snippet:
a) if (studentForm = null)
b) if (studentForm == null)
c) if (studentForm:null)
d) if (studentForm >= null)

1.26 Use the following code to answer this question:


<access_modifier> class <base_class_name>
{
// Base class Implementation
}
Page 6 of 14

C2 General Data Classification


Which of the following code inherits the properties of the base class into the child
class to improve code reusability?
a)
<access_modifier> PropertyMethodName <derived_class_name>
{
// Derived class implementation
}
b)
class <data type> : <Base class Implementation>
{
// Derived class implementation
}

c)
<access_modifier> Collection <derived_class_name> : <base_class_name>
{
// Derived class implementation
}

d)
<access_modifier> class <derived_class_name> : <base_class_name>
{
// Derived class implementation
}

1.27 To retrieve data using a DataReader, create an instance of the Command


object, and then create a DataReader by calling the
a) Command.ExecuteReader to retrieve rows from a data source.
b) constructor of the class
c) database class which implements CRUD functionalities
d) read method

Use the following code to answer the questions that follows:


Line 1: using StudentInfo_System.Database;
Line 2: namespace StudentInfo_System.Student_Entities
Line 3: {
Line 4: public class StudentController
Line 5: {
Line 6: StudentDB studentDB;
Line 7: }
Line 7: }

Page 7 of 14

C2 General Data Classification


1.28 The code in Line 1
a) is an indication of importing the Database folder into the current
Student_Entities folder
b) is an indication of exporting the Database folder out of the existing namespace
c) declares a reference to StudentInfo_System folder
d) declares a reference to the Database folder

1.29 The code snippet shows that there are


a) three classes
b) two main constructors
c) two namespaces within the program
d) two architectural layers implemented so far

1.30 Line 6 implies that


a) a class StudentDB exists
b) a database StudentDB exists
c) studentDB references StudentController
d) studentDB is a child class of the parent StudentController class.

Page 8 of 14

C2 General Data Classification


SECTION B: Systems Design [20]
1. CRUD are the basic operations in any RDBMS and an acronym for the four associated types
of SQL commands.
a. Populate Table 1 with information reflecting CRUD operations and their respective
SQL commands (column A with the CRUD functionalities and column B with the
associated SQL command). [4]

CRUD SQL
1
2
3
4
Table 1: CRUD operations and associated SQL commands

b. When we are building APIs, we want our models to provide the four CRUD
functionalities. Identify AND explain at least two benefits of CRUD operations
[4]

c. Identify at least two of the most important ADO.NET objects that are responsible for
the CRUD operations [2]

2. In systems development, Separation of Concerns refers to the delineation and correlation of


software elements.
a. What is the purpose or goal of Separation of Concerns? [2]

b. Identify three benefits of Separation of Concerns [3]

c. How can Separation of concerns be achieved? Give an example to illustrate [5]

Page 9 of 14

C2 General Data Classification


SECTION C:
Case Study Design and Implementation [100]

1. Explain Design in one sentence (underline the three key concepts) to Bongani. [3]

2. Pharmacare need reports from the eCommerce website. Based on the case describe
a. The content and objectives of a report
b. The type of report
c. The intended audience (stakeholders) and
d. The benefits for the intended audience. [4]

3. The five steps of the Stanford Design Thinking process are, Empathize, Define, Ideate,
Prototype and Test. Explain how each step could be used at Pharmacare to improve the
ordering system. Please be as specific to Pharmacare as possible. [5]

4. The first questions to ask regarding testing is What to test? Answer this question for the
Pharmacare eCommerce website. [5]

5. Which Project Management method should Pharmacare follow (Waterfall or Agile) to develop
the new eCommerce website? Justify your answer. [5]

6. DevOps is used within many companies in an attempt to increase IT productivity and


efficiency. Write a brief proposal to executive management (using headings Current Situation,
Define DevOps, and Why change now) on how Pharmacare could use and benefit from
DevOps. [8]

7. Design the screens for the “online purchasing option” on the Pharmacare website. Assume
the customer has logged on. Pay special attention to the business rules/ functional
requirements specified in the case study. [10]

Page 10 of 14

C2 General Data Classification


8. Use the systems design iteration presented in Figure 1 to answer the following question.
a. Explain the tasks involved in detailed design that makes it different from analysis and
comment as to whether Figure 1 is a good representation of a detailed design class
diagram [3]

b. Add to the iteration (Figure 1), information about the customer who makes an order

[10].
9. Using GRASP principles:
a. Identify class(es) in Figure 1 that would be ideal candidate(s) for creating instances of
the Item class? Motivate your answer. [2]

b. What is the benefit of using the principle used in question 9(a)? [2]

c. Explain why high coupling is undesirable in systems development [3]

10. A new order has a status of “pending”. While in pending status, an order can be cancelled
which will change its status to “cancelled”. Assuming an order can be in the following states:
unknown, pending, shipped, delivering, and cancelled, answer the following questions.
a. Class Order has a field status which captures the different states of an order. Write the
code that would allow status to reflect these different states. [5]

b. Properties in C# combine aspects of both fields and methods. To the user of an object,
a property appears to be a field. To the implementer of a class, a property is one or two
code blocks – in the first block, executed when the property is read; and in another
block, executed when the property is assigned a new value.Create a read-only property
for the field defined in question 10(a). [4]

c. There are three main Object-Oriented Principles used in systems development. Which
of these principles do you think is portrayed in question 10(a-b), and what are the
benefits of this principle towards systems design and implementation? [6]

Page 11 of 14

C2 General Data Classification


11. Some of the classes in Figure 1 have been implemented in the Pharmacase system. For
example, in the Database layer there is the DB class and the ProductDB class which inherits
from the DB class. Classes in the Entity layer include Product class, ProductController and
Customer class. The ProductForm class is situated in the Presentation layer.

a. Write the code in the ProductDB class to declare a collection of products. Assume that
this is the first time a collection is being declared in the class. [6]

b. Write the code for the constructor of the ProductDB class and create an instance of
the products collection in the constructor [4]

c. The ProductDB class has a void method DatabaseAdd which tries to fulfil one of the
CRUD functionalities – inserting data into the database. The method has tempProduct
as a parameter/variable of type Product. The body of the method, builds a SQL
statement that will be used to insert the data into the Product Table when the
UpdateDataSource method is called. A snapshot of the current method is shown below.
It has some errors and it is not complete. Correct the errors in the program.
[5]
public void DatabaseAdd()
{
decimal SQLInsert = "";
SQLInsert = "INSERT into Table()" +
"VALUES (" + GetValueString(tempProduct) + ")";
UpdateDataSource(new SqlCommand(SQLInsert, cnMain));
return SQLInsert;
}

d. To ensure that a layered approach is followed; explain and show how the presentation
layer communicates with the ProductDB class to access the DatabaseAdd method
[10]

--------------------------------------------- End of Exam -----------------------------------------------------

Page 12 of 14

C2 General Data Classification


Appendix: Exam Case study

Pharmacare.

Imagine you are the IT manager for a pharmaceutical distribution company Pharmacare, of between 50 – 100 employees in
each division across the country. Pharmacare does not sell to the general public, rather Pharmacare sells only to Pharmacy’s.
Pharmacare supplies pharmaceuticals (such as medicines and drugs) to dispensary’s, plus an established range of medical
supplies (electronic devices such as blood pressure monitors, self-care devices such as diabetes management tools, diagnostic
tools such as Sphygmomanometers to record blood pressure), surgical supplies (bandages, gauze, gloves, needles, syringes
etc), durable medical equipment (such as walking aids and wheelchairs), as well as a range of toiletries, a range of
cosmetics and beauty products, and a range of health foods. Many of the Pharmacies Pharmacare is supplying have
suggested that online access to the stock and an online ordering facility would be advantageous, as the current ordering
system was not coping. Customer complaints include incomplete orders, stock-outs, and incorrect account balances.

The company has been successfully running for the last 10 years and has a solid customer base, but it is now one of many
pharmaceutical distribution companies and has lost its competitive edge. Bongani Sagela, the Chief Operation Officer (COO)
and very influential member of executive management, has engaged with customers and thinks the customers should be
listened to.

Bongani presented a proposal for an eCommerce project to executive management in order to get approval for the project,
as he says he wants to improve the competitiveness of the company. He received approval for the project as the executives
want Pharmacare “to enter the digital era.” Bongani has asked you to draw up a project charter as the formal authority for
the project. Bongani agrees to serve as the primary sponsor of the project and appoints you as the project manager. Bongani
sees the eCommerce project involving the creation of a company website with transaction handling capabilities for key
customers. Bongani is excited and impatient, and he wants the project to be completed within four months.

It is currently August 2019. The company has no previous experience in developing online applications using web
technologies, but they do have internet access and space on a web server. The IT Department (which you manage) supports
all the divisions across the country with a shared infrastructure. The IT Manager is expected to provide strategic leadership
for IT services surrounding initiatives and projects, and coordinate with management on systems/services to enhance
services. The IT Department has four managers, the Network manager (Network Infrastructure, Desktops, Peripherals,
Mobiles, Communications, Network traffic), Development manager (Enterprise Architects, BAs, Developers, DBAs,
Testers, QA), Operations Manager (Change Management, Release Management, Help Desk, Applications, Data Storage,
Technical Support, Ops Infrastructure, DRP), and Security Manager (Security, Risk, Privacy). The IT Manager is responsible
for hiring, training, development, compensation, and performance management of IT staff.
In addition to creating the eCommerce application, Bongani has asked you to train two sales staff to do simple website
updates. The website should have a description of the organisation, the list of services offered, contact information, graphics
and an option for online purchasing for customers. The online purchasing option will need to have protected customer
password entry, and product codes on the online form should be selected from the Oracle ERP system used by the company.
Customers should be able to view the stock status accessed from the company’s ERP system, select products and add quantity,
and online submission of customer enquiries.
The executives would like to be able to see actual verse planned top selling products over a defined period by region. The
head of the development team has presented the second iteration of their design class diagram (Figure 1) to a strategic meeting
regarding the project. The iterations are based on the CustomerOrder package of the system. This package, models part of
the entire system as follows:

Page 13 of 14

C2 General Data Classification


the system has two types of customers namely companies and persons. The addresses and phone numbers of all
customers are kept. Additionally, the first and last names of persons and the names and government registration
numbers of companies are maintained. New persons and companies can be added. Persons and companies can only
be removed if they have not placed orders before. All the information of a customer can be modified. An order for
a customer can be created. The information that is associated with an order includes the customer, date, status and
order items. A new order has a status of “pending” and no items. While in pending status an order can be cancelled
which will change its status to “cancelled”.
New order items can be added to an order that is in a pending status. An order item is for a specific product. No two
order items may refer to the same product; instead an item should have a quantity greater than one. The quantity of
the product as well as the price of the product at the time the order item was created, is also kept. An order item
must have a quantity that is more than zero. An order item can be added regardless of the amount of stock that is
available. The quantity of an order item can be updated. Order items may be deleted. An order with status “pending”
can be processed if there are enough products in stock. Processing an order changes its status to “processed” and
the quantities of products in stock are reduced by the corresponding item quantities ordered. The order management
system keeps stock of various products. For each product its name, price and quantity in stock is recorded.
Bongani thinks these iterations are stalling the project and has indicated that this be the final iteration. He insists that
implementation start immediately and changes can be made later accommodate new requirements. Executive management
has allocated R5 million to the project. In addition to you as the project manager, there are also two additional employees –
Ammar and William, from marketing and sales who have been assigned to the project. You have also been authorised to hire
an eCommerce consultant, Kayla who will be placed on contract, and to use some of your internal IT staff.

Figure 1: Iteration

Page 14 of 14

C2 General Data Classification

You might also like