You are on page 1of 9

Graduate Diploma in Systems Analysis Page 1 of 9

SAMPLE PAPER
Institute of Systems Science
National University of Singapore

GRADUATE DIPLOMA IN
SYSTEMS ANALYSIS

SA Term 2 Examination
Sample Paper: Mobile Application Development

Matriculation Number :
(fill in your matriculation number here)

Instructions for Paper


Date: N.A
Time: 9.00am
Duration: 3 hours (9.30 a.m. to 12.30 p.m.) excluding reading time
Place: NUS MPSH4

This is an open book examination.


You are given 30 minutes to read the questions before the examination starts. You are NOT
allowed to use any writing instrument during the reading time.

1. Read all instructions before answering any of the examination questions.

2. Write your matriculation number on the top of this front page in the box provided.

3. Complete the front cover of each answer book you use. The blank lines on the front cover
to be filled in as follows:

Matriculation / Registration No: = (Your matriculation number)


Module Code/Title: = Sample Paper: Mobile Application Development
Semester: = SA Term 2
Number of books handed in: = (Indicate the number of booklets you have used for
each section.)

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 2 of 9

4. Write your matriculation number on ALL answer books you use.

5. This examination paper consists of three (3) sections with one (1) question in Section A,
one (1) question in Section B and one (1) question in Section C. There are a total of three
(3) questions. You are to answer ALL questions. There are no appendixes for this paper.

6. The total marks for this examination paper is seventy-five (75) marks. Twenty-five (25)
marks will be taken from the continuous assessment.

7. Use a separate answer book for each section.

8. Start the answer to each question on a new page.

9. After completing the paper, tie your answer books together according to sections. List the
questions that you have answered for each section on the front page of the first answer
book for that section.

10. The question paper is to be submitted together with the answer books. You are not
allowed to take the question paper with you.

11. Scrap paper may be used as required, but only answers written in the answer book will be
considered for credits.

12. Use a pen for writing your answers. Pencil may be used only for drawing diagrams.

13. Calculators may be used if required.

14. State clearly any assumptions you make in answering any question where you feel the
requirement is not sufficiently clear.

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 3 of 9

Section A
This section would be on Python programming.
Since it is a new topic, there is no sample question.

Section B [30 marks]


Question 3 [30 marks]

You have been task to prototype an Android native app which allows users to search the online
book store for titles and corresponding reviews.

I) The app will allow the user to key in a search string in the MainActivity.

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 4 of 9

II) Submitting the search will display a list of results in the ListBooks Activity:

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 5 of 9

III) Selecting a search result row will show a review for the corresponding book in the Review
Activity.

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 6 of 9

A WCF service hosted on ASP.NET for accessing the book database has been implemented at
http://192.168.56.101/books/ with IService.cs interface as follows:

IService.cs
using System;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

[ServiceContract]
public interface IService {
[OperationContract]
[WebGet(UriTemplate="/Search/{target}",ResponseFormat=WebMessageFormat.Json)]
Book[] SearchBooks(string target);

[DataContract]
public class Book {
string title;
string author;
string review;
float price;

[DataMember]
public string Title
{
get { return title; }
set { title = value; }
}

[DataMember]
public string Author
{
get { return author; }
set { author = value; }
}

[DataMember]
public string Review
{
get { return review; }
set { review = value; }
}

[DataMember]
public float Price
{
get { return price; }
set { price = value; }
}
}

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 7 of 9

In addition, the Java classes Book has also been implemented as follows:

Book.java
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;

import org.json.JSONArray;
import org.json.JSONObject;

import android.util.Log;

public class Book extends HashMap<String,String> {

private static final long serialVersionUID = 7701355780902549134L;

public Book(String title, String author, String review, String price) {


put("title", title);
put("author", author);
put("review", review);
put("price", price);
}

public static List<Book> readBook(String url) {


List<Book> book = new ArrayList<Book>();
try {
JSONArray a = JSONParser.getJSONArrayFromUrl(url);
for (int i =0; i<a.length(); i++) {
JSONObject b = a.getJSONObject(i);
book.add(new Book(b.getString("Title"),
b.getString("Author"),
b.getString("Review"),
Double.toString(b.getDouble("Price"))));
}
} catch (Exception e) {
Log.e("JSONArray error", e.toString());
}
return book;
}
}

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 8 of 9

a) With the supplied activity_main.xml, implement the MainActivity Activity which


responds to the “Search” button by retrieving user input and passing it to the second
ListBooks Activity.

res/layout/activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/booksearch"
android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="@string/searchhint" >

<requestFocus />
</EditText>

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText1"
android:layout_below="@+id/editText1"
android:layout_marginTop="24dp"
android:text="@string/searchbutton" />

</RelativeLayout>

You should show the implementation of the onCreate() method with

i. any Activity initialization as required, (4 marks)


ii. install an appropriate listener, and (2 marks)
iii. starting the next activity on a button click (4 marks)

SA Term 2 Examination Sample (Mobile Application Development)


Graduate Diploma in Systems Analysis Page 9 of 9

b) By subclassing from ListActivity, implement the second ListBooks Activity which

i. performs the book search (with the search string obtained from the first Activity) (4
marks)
ii. displays the search results in a ListView (4 marks)
iii. implement an appropriate event-handler for the ListView (4 marks)

c) With the supplied review.xml, implement the onCreate() method of the third Review
Activity which

i. performs the required Activity initialization (4 marks)


ii. obtains the book review of the book selected in the ListBooks Activity for
display (2 marks)

• res/layout/review.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceMedium" />

</LinearLayout>

d) List the Android permissions which should be included in the Manifest file. (2 marks)

~~~~~~~~ End of Section C ~~~~~~~~

~~~~~~~~ End of Paper 5 ~~~~~~~~

SA Term 2 Examination Sample (Mobile Application Development)

You might also like