程序代写代做代考 case study Java ER database SAMPLE PAPER

SAMPLE PAPER
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
Matriculation Number:
(fill in your matriculation number here)

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
3. OABS Use Case Diagram
Passenger
Administrator
Figure 1 Global Use Case Diagram

4 Portions of OABS ER Diagrams
Figure 2 OABS ER Diagram

Figure 3 –
StaticTe
st.java
class
Passenge
r{}
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) {
} }
Figure 4 – Simple Group of Classes
Passenger[] pa = { new Passenger(), new Member () }; for (Object o : pa)
getWeight((Passenger) o);
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 arrangePassengerById (List givenList)
// Add code here
// (Refer to question 1e)
// Complete Code
}
private Passenger findFirstPassenger
(ArrayList givenList)
{
{
} }
// Add code here
// (Refer to question 1e)
// Complete Code
}
private Passenger findLastPassenger
(ArrayList givenList) { // Add code here
// (Refer to question 1e)
// Complete Code }
public static void main(String[] args) { ListUtility prg = new ListUtility(); ArrayList originalList =
new ArrayList();
// 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 { 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() {
[. . .]
}
// 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; [. . .] } 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
Figure 10: TestEL.jsp
10 x 5 = ${10 * 5}
2 * 3 = <%= 2 * 3 %>
${50 + 43 lt 60 or 3 gt 1}
${234 div 0}
${empty dummy ? “nothing”:dummy}

Figure 11: Search Portion
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
[. . .]
/ Getters and Setters [. . .]
/ Other overridden methods of java.lang.Object [. . .]
}
/ /

Figure 13: FlightView.jsp
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 list = new ArrayList();
// 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
}
}