You are on page 1of 8

Graduate Diploma in Systems Analysis Page 1 of 8

SAMPLE PAPER
Matriculation Number:
(fill in your matriculation number here)

Appendix A – OABS Case Study

1. Overview of the Application


The Online Airline Booking System, or OABS for short, is designed to be an all in one
solution for an airline wishing to speed up and save money compared to a traditional
booking system. It consists simply of a server-side web application combined
powerful backend database to provide the user with a highly accessible system. The
project is code named OABS. Application administrator and passenger (aka internet
user) are the two actors of OABS application. Few high level requirements and
essential code fragments are provided in the further sections

2. Functional Requirements
The overall functionality of OABS is briefly described below:
a. The system supports two types of users: Passenger (internet user) and
application administrator.

b. Passenger can:
a. Log into the system
b. Search for flight availability by travel dates
c. Search for flight details
d. Search for seats left and ticket price
e. Search for his/her current booking along with status
f. Create and modify passenger profile
g. Book flight tickets for a single or round trip
h. Make a payment
i. Print flight tickets

c. Application Administrator can:


a. Log into the system
b. Manage flights, plane details and respective booking sales
c. Manage passenger details
d. Produce sales reports
e. Troubleshoot failed bookings based on help desk requests
f. Produce different reports as demanded by business users and
management
SA Term 2 Examination Sample (Paper 4 – Appendix A)
Graduate Diploma in Systems Analysis Page 2 of 8

3. OABS Use Case Diagram

Registration Profile

Search Flights

Authentication

Search Available Seats


Passenger

Payment
Search Booking <<include>>

Book Flights

Print Tickets

Authentication
Manage Plane

Manage Flights

Manage Payments
Administrator
Manage Passenger

Reports

Figure 1 Global Use Case Diagram

SA Term 2 Examination Sample (Paper 4 – Appendix A)


Graduate Diploma in Systems Analysis Page 3 of 8

4. Portions of OABS ER Diagrams

Figure 2 OABS ER Diagram

SA Term 2 Examination Sample (Paper 4 – Appendix A)


Graduate Diploma in Systems Analysis Page 4 of 8

Figure 3 – StaticTest.java
class Passenger { }
class Member extends Passenger { }
public class StaticTest {
static int x = 7;
static String s = null;
public static void getWeight(Passenger p) {
int y = 0 / x;
System.out.print(s + " ");
}
public static void main(String[] args) {
Passenger[] pa = { new Passenger(), new Member () };
for (Object o : pa)
getWeight((Passenger) o);
}
}

Figure 4 – Simple Group of Classes


public interface A {
public void doSomeProcess(String s);
}
public class AImpl implements A {
public void doSomeProcess(String s) {
System.out.println("A Imple Code");
[. . .]
}
}
public class B {
public A doIt() {
[. . .]
}
public String execute() {
[. . .]
}
}
public class C extends B {
public AImpl doIt() {
[. . .]
}
public Object execute() {
[. . .]
}
}
Figure 5 –ListUtility.java code skeleton
package bizlogic;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import model.Passenger;
public class ListUtility {
private ArrayList<Passenger> arrangePassengerById
(List<Passenger> givenList) {
// Add code here
// (Refer to question 1e)
// Complete Code
}
private Passenger findFirstPassenger
(ArrayList<Passenger> givenList) {
SA Term 2 Examination Sample (Paper 4 – Appendix A)
Graduate Diploma in Systems Analysis Page 5 of 8

// Add code here


// (Refer to question 1e)
// Complete Code
}
private Passenger findLastPassenger
(ArrayList<Passenger> givenList) {
// Add code here
// (Refer to question 1e)
// Complete Code
}
public static void main(String[] args) {
ListUtility prg = new ListUtility();
ArrayList<Passenger> originalList =
new ArrayList<Passenger>();
// Use constructor to create instance
Passenger p1 = new Passenger (. . . );
Passenger p2 = new Passenger (. . . );
Passenger p3 = new Passenger (. . . );
originalList.add(p1);
originalList.add(p2);
originalList.add(p3);
System.out.println("ORIGINAL LIST");
for (Passenger passenger : originalList) {
System.out.println(passenger.toString());
}
originalList =
originalList.arrangePassengerById(originalList);
System.out.println("SORTED LIST");
for (Passenger passenger : originalList) {
System.out.println(passenger.toString());
}

Passenger first = prg.findFirstPassenger(originalList);


Passenger last = prg.findLastPassenger(originalList);
System.out.println("FIRST ITEM" + first.toString());
System.out.println("LAST ITEM" + last.toString());
}
}

Passenger.java

package model;
import java.util.Date;
public class Passenger implements Comparable<Passenger> {
private String idPassenger;
private String firstName;
private String lastName;
private String nric;
[. . .]
// Constructor
public Passenger (. . .) {
this.idPassenger = idPassenger;
this.firstName = firstName;
this.lastName = lastName;
[. . .]
}
[... getter and setter methods ...]
[. . .]
public String toString() {

SA Term 2 Examination Sample (Paper 4 – Appendix A)


Graduate Diploma in Systems Analysis Page 6 of 8

[. . .]
}
// Add code here
// (Refer to question 1e)
// Complete Code
}

Figure 6 MichaelStack.java
public class MichaelStack<T> {
private int index = 0;
public static final int MAX = 3;
private T[] data = (T[])new Object[MAX];
public void push(T obj) {
data[index++] = obj;
}
public boolean hasNext() {
return index > 0;
}
public boolean hasRoom() {
return index < MAX;
}
public T pop() {
if (hasNext()) {
return data[--index];
}
throw new ArrayIndexOutOfBoundsException(-1);
}
}

public class TestStack {


public static void main(String[] args) {
String[] strlist = {"KOMALA ",
"SU MON","KUANG"};
Integer[] intlist = {20, 30, 60, 45};
// Complete code by calling MichaelStack’s
// push(...) and pop() methods in sequence over
// data strlist and intlist.
// (Refer to question 1f)
[. . .]
}
}

Figure 7 – PaymentDAO.java
public interface PaymentDAO {
[. . .]
public Double findSalesAmountByDate(java.util.Date paymentDate)
throws PaymentFinderException, SQLException;
[. . .]
}

SA Term 2 Examination Sample (Paper 4 – Appendix A)


Graduate Diploma in Systems Analysis Page 7 of 8

Question 2
Figure 8: SillyJellyBean.java
[. . .]
public class SillyJellyBean {
private String a, b, c;
public JellyBean() { a=“A”; b=“B”; c=“C”; }
public void setA (String a) { this.a=a; }
public void setB (String b) { this.b=b; }
public void setC (String c) { this.c=c; }
public String getA() { return a; }
public String getB() { return b; }
public String getC() { return c; }
public String getAll() { return a+b+c; }
}

Figure 9: MyJBTrial.jsp
<jsp:useBean id=“jb” class=“xxx.SillyJellyBean” />
<jsp:getProperty name=“jb” property=“a” />
<jsp:getProperty name=“jb” property=“b” />
<jsp:getProperty name=“jb” property=“c” />
<jsp:setProperty name=“jb” property=“a” param=“b”/>
<jsp:setProperty name=“jb” property=“b” param=“c”/>
<jsp:setProperty name=“jb” property=“c” param=“a”/>
<jsp:getProperty name=“jb” property=“a” />
<jsp:getProperty name=“jb” property=“b” />
<jsp:getProperty name=“jb” property=“c” />

Figure 10: TestEL.jsp


10 x 5 = ${10 * 5} <br>
2 * 3 = <%= 2 * 3 %> <br>
${50 + 43 lt 60 or 3 gt 1} <br>
${234 div 0} <br>
${empty dummy ? "nothing":dummy}

Figure 11: Search Portion

Flight Number
Departure Date
City Code

Figure 12: Search Portion


package dto;
import java.util.Date;
public class FlightDTO {
private int idFlight;
private java.util.Date depature;
private java.util.Date arrival;
private String departureCityCode;
private String arrivalCityCode;
private String departureCity;
private String arrivalCity;
// Constructors
SA Term 2 Examination Sample (Paper 4 – Appendix A)
Graduate Diploma in Systems Analysis Page 8 of 8

[. . .]
// Getters and Setters
[. . .]
// Other overridden methods of java.lang.Object
[. . .]
}

Figure 13: FlightView.jsp

A20067
12/12/13
SIN

Kuala Lumpur

Yangon

Sydney

Figure 14: SearchServlet.java


[. . . ]
public class SearchServlet extends HttpServlet
{
private int counter;
private String message;
public void doPost(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException
{
ArrayList<Passenger> list = new ArrayList<Passenger>();
// Call to business layer
[. . .]
request.setAttribute("result", list);
// Section 2.d starts here
// Setting data in request Scope

[Complete code stated in 2 (d)]

// Section 2.d ends here


}
}

SA Term 2 Examination Sample (Paper 4 – Appendix A)

You might also like